I found this exercise: let $M$ be a metric space, and $f: M \to \Bbb R$ be a function, and $A = \{ x \in M \mid f(x) > 0\}$. Prove that if $x \in \partial A$, then $f(x) = 0$.
I think that we must assume continuity for this result. We have that for every $n \geq 1$, there is $r_n > 0$ such that $f(B(x, r_n)) \subset (f(x) - 1/n, f(x) + 1/n)$. Since $x \in \partial A$, we have that $B(x, r_n)\cap A \neq \varnothing$ for all $n$. So we get points $y_n \in B(x, r_n) \cap A$, in other words, $f(y_n) > 0$ for all $n \geq 1$, which gives us that: $$-\frac{1}{n} < f(y_n) - \frac{1}{n} < f(x),\,\forall\,n \geq 1 \implies f(x) \geq 0.$$Repeating this discussion for $M \setminus A$ ensures that $f(x) \leq 0$, and we conclude that $f(x) = 0$.
Can someone confirm about the continuity hypothesis, and give some input on the idea used? (I wrote it a bit sloppily, I know). Thanks.