Example of clopen sets in $X := (0, 1) \cup \{2\} \subseteq \mathbb R$

I come across this example from this answer. Could you check if my understanding is correct?

Let $X := (0, 1) \cup \{2\} \subseteq \mathbb R$. We endow $X$ with the usual norm $| \cdot |$. Because $\{2\} = \mathbb B_X(2, 1/2) = \overline{\mathbb B}_X(2, 1/2)$, so $\{2\}$ is clopen in $X$. It follows that $(0,1) = X \setminus \{2\}$ is also clopen in $X$. We can also obtain the closeness of $\{2\}$ by the fact that in metric space, a singleton is closed.


Solution 1:

Yes, looks good. Note that $\{2\}$ is also closed for the reason that $(0,1)$ is open in $X$, so that its complement is closed per definition.