Let $S$ be a metric space, $ f: S \to \Bbb R$ continuous. Define $Z(f) = \{p \in S : f(p) = 0 \}$. Prove $Z(f)$ is closed. Let $S$ be a metric space, $ f: S \to \Bbb R$ continuous. Define $Z(f) = \{p \in S : f(p) = 0 \}$. Prove $Z(f)$ is closed.
I've come up with a proof... I just would like to know if it is logical enough or it needs to be improved upon somehow. It seems very long for a simple idea.
Below is my proof: 
Must show $\Bbb R \setminus Z(f)$ is open.
$\quad \Bbb R \setminus Z(f)= \{x: f(x) \ne 0\} = \{x: f(x) > 0\} \cup \{x: f(x) <0\}$
It's enough to show $\{x: f(x) > 0\}$ is open if $f$ is continuous, because $\{x: f(x) < 0\} = \{x: -f(x) > 0\}$, and $-f$ is continuous if $f$ is continuous. 
So, let $x \in \Bbb R$ be such that $f(x) > 0$. There exists $\epsilon > 0$ such that $f(x) > \epsilon$.
Say $\epsilon = \frac{f(x)}{2}$, since $f$ is continuous, there exists $\delta >0$ such that
$\quad |f(x) - f(y)| < \epsilon = \frac{f(x)}{2}$ if $|x-y| < \delta$
then,
$\quad-\frac{f(x)}{2} < f(y) - f(x) < \frac{f(x)}{4}$
so,
$\quad f(y) > f(x) - \frac{f(x)}{2} = \frac{f(x)}{2} > 0$
since $y$ with $|y - x| < \delta$ is arbitrary, $(x - \delta, x + \delta) \subset \{x : f(x) > 0 \}$
Therefore $Z(f)$ is closed.

Another way is to use sequential characterization, so let $(p_{n})\subseteq Z(f)$ be such that $p_{n}\rightarrow p$ in $S$, then continuity of $f$ gives $f(p_{n})\rightarrow f(p)$. But $f(p_{n})=0$, so $f(p)=0$, this shows that $p\in Z(f)$, we are done.
