Prove that a nonempty subset $C$ of $\mathbb{R}$ is closed if and only if $d(x,C)\gt 0$ for each point $x$ in the complement of $C$.
I have the first direction of the proof. Now assume $d(x,C)\gt 0$ for each point $x$ in the complement of $C$ and that $C$ is nonempty subset of $\mathbb{R}$. Show $C$ is closed.
Since $d(x,C)\gt 0$ and $C=\mathbb{R}\setminus(\mathbb{R}\setminus C))$, we have $d(x,\mathbb{R}\setminus(\mathbb{R}\setminus C))\gt 0$. From here, do I have to show there is an open interval centered at $x$ and contained in $\mathbb{R}\setminus C$? Which then implies $\mathbb{R}\setminus C$ is open?
$C$ is closed
$\Leftrightarrow$ $\mathbb{R} \setminus C$ is open
$\Leftrightarrow$ $ \forall x \in \mathbb{R}\setminus C, \exists \varepsilon > 0, (x-\varepsilon, x + \varepsilon) \subset \mathbb{R} \setminus C$
$\Leftrightarrow$ $ \forall x \in \mathbb{R}\setminus C, \exists \varepsilon > 0, (x-\varepsilon, x + \varepsilon) \cap C = \emptyset$
$\Leftrightarrow$ $ \forall x \in \mathbb{R}\setminus C, \exists \varepsilon > 0, d(x,C) > \varepsilon$
$\Leftrightarrow$ $ \forall x \in \mathbb{R}\setminus C, d(x,C) > 0$