How can I tell if a subset of a metric space is closed or open intuitively? I know the formal definitions of open and closed. More specifically, a set is open if the interior points of the set are contained in the set. A set is closed if the limit points of the set are contained in the set. Here is the question I'm dealing with:
Let $X$ be a metric space and let $A\subset X$.

*

*$A=\{(x,y)|x^2>y\}$


*$A=\{(x,y)|x^2+y^2 =1\}$


*$A=\{(x,y)|x\text{ is rational}\}$


*$A=\{(x,y)|x\geq 0, y\geq 0\}$
I think $1$ is open, $2$ is closed, $3$ is neither, $4$ is closed. This is just based on picturing the graphs and seeing if limit points/interior points are within the given range. But I feel like there has to be a better way to justify it. I also think the sets being $2$-dimensional are throwing me off.
 A: Within such context, it is useful to remind the following property of continuous mappings: the preimage of open sets are open and the preimage of closed sets are closed.
We may now consider each case separately.
(a) Let $f:(\mathbb{R}^{2},\|\cdot\|_{2})\to(\mathbb{R},|\cdot|)$ be defined as $f(x,y) =  y - x^{2}$.
Then we can say that $A$ is open because $A = f^{-1}(-\infty,0)$ and $(-\infty,0)$ is open, where $f$ is continuous.
(b) Similarly, let us define $g:(\mathbb{R}^{2},\|\cdot\|_{2})\to(\mathbb{R},|\cdot|)$ as $g(x,y) = x^{2} + y^{2} - 1$.
Then we can say that $A$ is closed because $A = g^{-1}(\{0\})$ and $\{0\}$ is closed, where $g$ is continuous.
(c) Such set is neither open nor closed. That is because no matter the rational number $q\in\mathbb{Q}$ one chooses, any open ball $B_{\varepsilon}(q)$ is not contained in $\mathbb{Q}$. On the other hand, $\overline{\mathbb{Q}} = \mathbb{R}$. Thus $\mathbb{Q}\not\supseteq\overline{\mathbb{Q}}$.
(d) Let us define $f:(\mathbb{R}^{2},\|\cdot\|_{2})\to(\mathbb{R},|\cdot|)$ as $f(x,y) = x$ and $g:(\mathbb{R}^{2},\|\cdot\|_{2})\to(\mathbb{R},|\cdot|)$ as $g(x,y) = y$.
Hence we can say that $A$ is closed because $A = f^{-1}([0,\infty))\cap g^{-1}([0,+\infty))$ and the set $[0,+\infty)$ is closed, where both $f$ and $g$ are continuous.
Hopefully this helps !
A: A lot of times it is really convenient to work with sequences, as their properties work really well with, for example, continuity. So say you have a metric space $(X,d)$ and a subset $A\subseteq X$ which you want to know if it is closed. One way to do this would be to let $\{x_n\}_{n\in\mathbb{N}}$ be a convergent sequence in $A$ with limit $x\in X$. If you are able to show that $x\in S$, then it follows that $S$ is closed. This is simply a sequential characterisation of closed sets. Futhermore you can also use this if you want to show that $A$ is open instead, as this is equivalent to $X\setminus A$ being closed.
Now let me give you an example of how this can be used to show a set is closed by looking at one of your sets. Here I also want to point out that your sets don't make sense for arbitrary metric spaces. So we consider the metric space $\mathbb{R}^2$ under the standard Euclidean metric, and the two subsets
$$S_1=\{(x,y)\in\mathbb{R}^2 : x^2+y^2=1\},$$
$$S_2=\{(x,y)\in\mathbb{R}^2 : x\in\mathbb{Q}\}.$$
Let $\{(x_n,y_n)\}_{n\in\mathbb{N}}$ be a convergent sequence in $S_1$ with limit $(x,y)\in X$. This means that for all $n\in\mathbb{N}$ we have that
$$x_n^2+y_n^2=1.$$
Now taking the limit of this as $n\to\infty$ we get that
$$1=\lim_{n\to\infty}\left(x_n^2+y_n^2\right)=x^2+y^2$$
by continuity. Thus $(x,y)\in S_1$, and so $S_1$ is closed.
Now let's move on to $S_2$. Since $\mathbb{Q}$ is dense in $\mathbb{R}$ we can let $\{x_n\}_{n\in\mathbb{N}}$ be a sequence in $\mathbb{Q}$ with limit $x\in\mathbb{R}\setminus\mathbb{Q}$. From this, just let $\{y_n\}_{n\in\mathbb{N}}$ be an arbitrary convergent sequence in $\mathbb{R}$ with limit $y\in\mathbb{R}$. This means that $\{(x_n,y_n)\}_{n\in\mathbb{N}}$ is a convergent sequence in $S_2$ with limit $(x,y)\in\mathbb{R}$, but as $x\in\mathbb{R}\setminus\mathbb{Q}$, this limit is not in $S_2$. Thus $S_2$ is not closed.
Furthermore we can use a similar argument to show that $S_2$ is not open. So consider the set
$$\mathbb{R}^2\setminus S_2 =\{(x,y)\in\mathbb{R}^2 : x\in\mathbb{R}\setminus \mathbb{Q}\}.$$
Since $\mathbb{R}\setminus\mathbb{Q}$ is dense in $\mathbb{R}$ we can use a similar argument to construct a sequence of irrational numbers with its limit being rational, and from this construct a sequence in $\mathbb{R}^2\setminus S_2$ with limit in $S_2$, which shows that $\mathbb{R}^2\setminus S_2$ is not closed, and hence $S_2$ is not open.
A: An open set is an union of open balls. This may be counterintuitive at first, but a rectangle $(a,b)\times (c,d)$ in the plane is the union of open disks: choose a dense subset of points in the rectangle, and at each of these points take the biggest open ball included in the rectangle. Then the union of all these balls is precisely the rectangle.
This may give a bit of intuition concerning open sets.
