If $[a_1,b_1] $and $[a_2,b_2] $ are closed intervals... The problem says:
Let $[a_1,b_1]$ and $[a_2,b_2]$ two closed intervals in $\mathbb{R}$. 
Prove that $[a_1,b_1] \times [a_2,b_2]$ ss a closed set in $\mathbb{R}^2$. 
Generalize in $\mathbb{R}^n$.
My teacher did a similar problem with $A$ and $B$ open and he used open balls. 
I tried to do it with closed balls but I have no idea if it's correct or if I can do that. Thanks.
 A: 
A subset $A$ of a metric space $(X,d)$ is closed iff for every sequence $x_n \in A$ such that $x_n \to x$ we have that $x \in A$

We the metric space $(\mathbb{R}^2,d_2)$ where $d_2(x,y)=\sqrt{(x_1-y_1)^2+(x_2-y_2)^2}$
Let $x_n=(y_n,z_n) \in A=[a_1,b_1] \times [a_2,b_2]$ such that $x_n \to x=(y,z)$ with respect to the usual metric of $\mathbb{R}^2$
You can prove that $$y_n \to y$$ $$z_n \to z$$ in $\mathbb{R}$
But $y_n \in [a_1,b_1]$ which is a closed subset of $\mathbb{R}$ thus $y \in [a_1,b_1]$
Also $z \in [a_2,b_2]$ using the same argument.
Thus $x=(y,z) \in [a_1,b_1] \times [a_2,b_2]=A$ ,so $A$ is closed.
Combine  the same proof as i did  with induction  in the case of $(\mathbb{R}^n,d_2)$ where $d_2(x,y)=\sqrt{(x_1-y_1)^2+....+(x_n-y_n)^2}$

Also for a second proof use this:
$ \mathbb{R}^2$  \ $(A \times B)=(A^c \times \mathbb{R}) \cup (\mathbb{R} \times B^c)$
where $$A=[a_1,b_1]$$ $$B=[a_2,b_2]$$ $$A^c=(- \infty,a_1) \cup (b_1, +\infty)$$ $$B^c=(- \infty,a_2) \cup(b_2, +\infty)$$ and prove that $ \mathbb{R}^2$  \ $(A \times B)$ is an open set.

