Open set and boundary points

Problem: Let $(M,d)$ a metric space and $f:M\rightarrow \mathbb{R}$ a continuous functions.

1. Show that the set $A = \{x\in M \mid f(x) > 0\}$ is open.

2. Let $a\in \partial A$. Show that $f(a)=0$.

3. Show that the reciprocal of 2) is in general, false.

Partial solution: For 1), let $a\in A$, then $f(a)>0$. And since $f$ is continuous, we have that for some $\varepsilon > 0$ exists some $\delta >0$ such that if $d(x,a)<\delta$, then $d(f(x),f(a))<\varepsilon$. Now, $d(f(x),f(a))=\mid f(x)-f(a) \mid <\varepsilon$ and this implies that $f(a)<f(x)<f(a)+\varepsilon$. Since $f(a)>0$, we have that $f(x)>0$ when $d(x,a)<\delta$, so, there is a ball $B(a,\delta) \subset A$, then $A$ is open.

Im pretty lost for 2) and 3). I know that if $a\in \partial A$, $B(a,r)\cap A \neq \emptyset$ and $B(a,r)\cap M-A \neq \emptyset$. But I have no idea how to prove what the book wants. Any help would be really appreciated.

EDIT: Cant use anything but the definition of open set, not sequences, not convergence!

Some hints:

1. It's easier to show that $A$ is the preimage of an open set in $\mathbb{R}$.
2. As $A$ is open, $a \in \partial A$ is not an element in $A$, thus $f(a) \leq 0$. By continuity, we know that for every $\epsilon > 0$ there is a $\delta > 0$, such that for every $x \in B(a, \delta)$, we have $|f(x)| < \epsilon$. But we also know that there is some $x \in B(a,\delta) \cap A$, so we get $0 < f(x) < \epsilon$. By this we may obtain a sequence $(x_n) \subset A$, converging to $a$, such that $f(x_n) = \frac1n$. By continuity again we see that $f(a) = f(\lim x_n) = \lim f(x_n) = \lim \frac1n = 0$.
3. Try to find an example for which $a$ is in the boundary of the set $B := \left\{ x \in M \mid f(x) < 0 \right\}$, but not in $\partial A$. Then by similar arguments as for 1. and 2., $B$ is open, and $f(a) = 0$, but $a \notin A$.
• I cant use the notion of convergence nor sequences yet, I just edited my post. Thanks anyways because your answer was very englighting – user1trill Sep 8 '18 at 22:24
1. You can simply say that $A=f^{-1}\bigl((0,+\infty)\bigr)$. Since $f$ is continuous and $(0,+\infty)$ is open $A$ is open.
2. If $a\in\partial A$, then we can't have $f(a)>0$, because then $a\in A=\mathring A$, since $A$ is open. And we can't have $f(a)<0$ because if $B=\{x\in M\,|\,f(x)<0\}$ then $B$ is open (just as $A$) and $a\in B$. So, there's a $r>0$ such that $B_r(a)\subset B\subset A^\complement$ and therefore $a\notin\partial A$.
3. Take $M=\mathbb R$ and let $d$ be the usual distance. Define $f(x)=x^3-3x-2$. Then $f(-1)=0$, but $A=(2,+\infty)$. Therefore, $-1\notin\partial A$.

For 1 use the fact that $A$ is the preimage of an open set under a continuous maping.

For 2 find a sequence in $A$ which converge to $a$ (why can you do that?) and use the continuity of $f$. You will need to know what happen with limit points under continuous functions.

With the reciprocal in 3 do you mean that $f(a)=0$ does not imply $a\in \partial A$ or what do you mean?

1. As $f$ is continous and the set $(0, \infty)$ is open then the set $f^{-1}(0, \infty)$ should be open. But $f^{-1}(0, \infty)=A$
2. In the same way we can show that the set $B = \{x\in M \mid f(x) < 0\}$ is open. Now what if $f(a)\neq0$ ?
3. You may take $g=0$