Let $f$ be a continuous real function on a metric space $X$. Let $Z(f)$ (the zero set of $f$) be the set of all $p \in X$ at which $f(p) = 0$. Prove that $Z(f)$ is closed.
My attempt
Let $p$ be a limit point of $Z(f)$. Then, for every $\epsilon > 0$ there is a $\delta > 0$ s.t. $d_x(x,p) < \delta$ for $x \in Z(f)$.Since $f$ is continuous that implies that $d_y(f(x),f(p))<\epsilon$, then $d_y(0,f(p)) < \epsilon$. So $d_y(0,f(p) = 0$ since $\epsilon$ was arbitrary. Hence $f(p) = 0$ so $p \in Z(f)$.
Is my proof sound?