# Proving that $f \big|_{\partial A} = 0$, where $A = [f> 0]$.

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.

• some sort of continuity is definitely required. If you define $f$ to be $1$ on $(0,1)$ and $-1$ everywhere else, then the statement is not true. – Callus Jul 6 '15 at 23:42
• You are right about the continuity hypothesis : take $M = \mathbb{R}$ and $f$ such that $f(x) = 1$ if $0<x<1$ and $f(x) = -1$ otherwise. Then $A = (0,1)$ and $\partial A = \{0,1\}$. Obviously $f(0) \neq 0$ and $f(1)\neq 0$. – Abelmondo Jul 6 '15 at 23:45
• Yeah, it seems so. If we take $f(x) = 1$ for all $x \neq 0$ and $f(0) = -1$ then the result also fails. Continuity can't break even at one point, then. Thanks guys! – Ivo Terek Jul 6 '15 at 23:47

## 1 Answer

The hypothesis of continuity is necessary, and it can't be relaxed at even one point. A few counter-examples are given in the comments.