Definition: Let $(X, d)$ be a metric space. A set $A \subseteq X$ is open if $\forall x \in A \exists \varepsilon >0$ such that $B_{\varepsilon}(x) \subseteq A$. A set $O$ is open if and only if $X \setminus O$ is closed.
I am just confused regarding the last part. For example, let's let $X = \{0\} \cup \{1\} \cup \{2\} \cup (3, 7)$ and let $d$ be the usual distance metric in $\mathbb{R}$. Now say $O = \{0\}$, clearly this set is open since we can find an open ball around it (i.e., there exists a $\varepsilon>0$ such that $B_{\varepsilon}(0) = \{0\}$) which is contained in $\{0\}$. However, now consider the set $X \setminus \{0\} = \{1\} \cup \{2\} \cup (3, 7)$. But this set is not closed because $3$ is a limit point and $3$ is not included in the set. Can someone explain to me where my understanding has failed?