I was at a written exam in mathematical and numerical analysis, and I'm unsure of the answer to two problems about sets being open or closed. The first problem is about Topology of $\mathbb{R}^2$: "Consider $$ A=\bigcup^\infty_{n=1} (-1/n,1/n) \times [-1,1]$$ $$ B=\bigcap^\infty_{n=1} (-1/n,1/n) \times [-1,1]$$ Wich statemanet is true? (a): A is open. (b): A is closed. (c): B is open. (d): B is closed. " I don't remember my reasoning behind it but I answered (d). I have worked on it at home a bit and now I would change my answer to (b). My work at home: $ A=\bigcup^\infty_{n=1} (-1/n,1/n) \times [-1,1] = (-1/1,1/1) \times [-1,1] \cup (-1/2,1/2) \times [-1,1] \cup ...$ $ A= (-1,1)\times [-1,1] \cup ... = \bigcup\{(-1,-1],[-1,1],[-1,1),[1,1) \} \cup ... = [-1,1] \cup (-1/2,1/2) \times [-1,1] ...= [-1,1] $ What I found difficult with this problem was the cartesian product, which I am not sure how to apply if it as not with any operation. For example $ (a,b) \times (c,d)= (a*c, b*d)$
The other problem was about continuity: "Consider $$A=\{ x \in \mathbb{R} : sin(x)\neq cos(x)\} \subset \mathbb{R}$$ Which satement is true? (a) A is open and closed. (b) A is neither open nor closed. (c) A is closed. (d) A is open. " I answered (d) A is open, since $ A=\{ x \in \mathbb{R} : sin(x)\neq cos(x)\} \subset \mathbb{R} = (-\infty, \infty) \setminus \{x : sin(x)=cos(x)\}$ $A = (-\infty , \infty) \setminus \{[x_1], [x_2], [x_3], ... ,[x_n]\} = (-\infty, x_1) \cup (x_1,x_2) \cup ... \cup (x_n,\infty)$
Concerning your first problem,$$A=(-1,1)\times[-1,1]\text{ and }B=\{0\}\times[0,1]$$and therefore (d) is the correct answer.
Concerning your second problem, let $f(x)=\sin(x)-\cos(x)$. Than $A=f^{-1}\bigl(\mathbb R\setminus\{0\}\bigr)$, and therefore, since $f$ is continuous and $\mathbb R\setminus\{0\}$ is an open set, $A$ is an open set.