Problem with closed set examples Given $(\mathbb{R}^2,d)$ is an Euclidean metric space.
Show that $U=\{(x,y)\in \mathbb{R}^2: y=0\}$ is closed in $\mathbb{R}^2$.
I use this definition for a closed set

In a metric space $X$, a set $S\subset X$ is closed if $S=\bar{S}$.

It is easier to prove that $U$ is closed by using definition: "A set $U$ is closed if $U^c$ is open". But, I need to prove that $U$ is closed by using its closure.
This is my attempt:
Take any $(x,0)\in \mathbb{R}^2$ and $\varepsilon>0$. I want to show that $B((x,0),\varepsilon)\cap U\neq\emptyset$.
Consider $(x-\frac{\varepsilon}{2},0)\in U$.
Then, I have
$d((x,0),(x-\frac{\varepsilon}{2},0))=\sqrt{(x-(x-\frac{\varepsilon}{2})^2+(0-0)^2}=\sqrt{\frac{\varepsilon^2}{4}+0}=\sqrt{\frac{\varepsilon^2}{4}}=\frac{\varepsilon}{2}<\varepsilon.$
It implies that $(x-\frac{\varepsilon}{2},0)\in B((x,0),\varepsilon)$.
Then, $B((x,0),\varepsilon)\cap U\neq\emptyset$ and $(x,0)\in \bar{U}$.
Hence, $\bar{U}=\{(x,0)\in \mathbb{R}^2:x\in \mathbb{R}\}$ and $U=\bar{U}$.
So, $U$ is closed.
I am not sure it's correct or not because it's first time for me to prove that a set is closed in $\mathbb{R}^2$. If someone can help guide / give the answer it would be really helpful.
Thank you.
 A: There are two ways of doing this. What you have done is incomplete because you have shown that all points $(x,0)$ are limit points. But you have not shown that the points in $\mathbb{R^{2}}\setminus U$ are not limit points.

*

*You take any point say $(x_{0},0)$ in the set and try to construct a ball of radius $\epsilon$ around it. Then it contains an infinite number of points of the set $U$, namely $\{(x,0):x_{0}-\epsilon<x<x_{0}+\epsilon\}$ belongs to $U\cap B((x_{0},0),\epsilon)$.

And for any point in $\mathbb{R^{2}}$ say $(x,y)$ and $y\neq 0$. Then $B((x,y),\frac{|y|}{10})$ is an open set which does not contain any point of the set $U$. Hence any point $(x,y)\in\mathbb{R^{2}}$ such that $y\neq 0$ is not a limit point of the set.
Hence $U'=U$. So $\bar{U}=U\cup U'=U$. and hence is closed.


*Well even in the first method we have shown that $\mathbb{R}^{2}\setminus U$ is open. And hence $U$ is closed.

A: What you have to do is taking $(x,y)\in \mathbb{R}^2\backslash U$ and proving that there is a ball centered at $(x,y)$ that doesn't intersect $U$ (i. e., that every point not in $U$ is not in the closure). Just consider the ball of radius $|y|$. This way you show that $\overline{U}\subseteq U$ and since the reverse inclusion always holds, you get the result.
A: One way, in a metric space, to show that $U$ is closed is to show that if $(p_n)_{n\in\Bbb N}$ is a sequence of members of $U$ and if $\lim_{n\to\infty}d(p_n,p)=0$ then $p\in U$, as follows:
Let each $p_n=(x_n,y_n).$ Then $y_n=0$ by definition of $U,$ so $p_n=(x_n,0).$
Let $p=(x,y).$ Then for every $n$ we have $d(p_n,p)=((x_n-x)^2+y^2)^{1/2}\ge |y|.$ So $d(p_n,p)$ cannot converge to $0$ as $n\to\infty$ unless $|y|=0.$ So $y=0.$
Therefore $ p=(x,0)\in U.$
