Proof verification: Prove that zero set of $f$ is closed. I'm trying to prove the following:
For a real valued continuous function $f : X \to \mathbb{R}$ on a metric space $(X,d)$ define $S = \{x \in X : f(x) = 0\}$. Show that $S$ is closed.
The proof I thought of is different than the suggested proof and I just wanted to check if this works too. Basically I am trying to use the idea that for any open ball around each limit point of $S$ we can find a point that takes $f$ to $0$ (by definition of limit point) and by continuity of $f$ it must be that the limit point itself takes $f$ to $0$. Not sure if this proof gets at that correctly.
Proof.
Let $x^*$ be a limit point of $S$, we want to show that $ x^* \in S$ i.e. $f(x^*) = 0$.
Take $\varepsilon > 0$. Since $f$ is continuous at $x^*$ there exists $\delta > 0$
such that $$d(f(x^*), f(x)) < \varepsilon$$ for $x \in X$ with
$$d(x^*,x) < \delta$$
Since $x^*$ is a limit point of S, we can find an $x' \neq x^* \in S$ such that $d(x^*, x') < \delta$, so
$$d(f(x^*), f(x')) = d(f(x^*), 0) < \varepsilon \implies f(x^*) = 0$$
i.e. $x^* \in S$. Thus $S$ contains all of its limit points so $S$ is closed.
 A: The proof is good, but I do have some stylistic pointers:

*

*Use the explicit distance on $\Bbb{R}$, instead of overloading $d$ as both metrics. For instance, $d(f(x^*), f(x)) < \varepsilon$ can be more clearly stated as $|f(x^*) - f(x)| < \varepsilon$. Using $d$ for both metrics makes it slightly more difficult on the reader to keep track of which expression belongs in which space.


*The conclusion $d(f(x^*), 0) < \varepsilon \implies f(x^*) = 0$ should be expanded a little. There's no reason to say that, if $d(f(x^*), 0) < \varepsilon$ for the fixed (arbitrary) $\varepsilon > 0$, then $f(x^*) = 0$. That is, it is not technically correct to say that the individual expression $d(f(x^*), 0) < \varepsilon$ implies, on its own, the next expression $f(x^*) = 0$.Instead, you should write "$\ldots \implies |f(x^*)| < \varepsilon$ for all $\varepsilon > 0$. Therefore, $f(x^*) = 0$." This makes it clear that $f(x^*) = 0$ follows from the whole argument, which works for any arbitrary $\varepsilon > 0$.
Other than that, the proof is good!
A: You can use the facts that:

*

*$S=f^{-1}(\{0\})$ and one-point sets are closed in $\mathbb{R}$


*functions of topologycal spaces are continuous iff inverse image of closed sets are closed.
So this proof is trivial.
