# Let $\displaystyle f$ be a continuous real valued function on the metric space $\displaystyle (X,d)$.

Let $f$ be a continuous real valued function on the metric space $(X,d)$. Let $A$ be the set of all $x\in M$ such that $f(x)\geq 0$. Show that $A$ is closed.

$(1) Proof:$ To show that $A$ is closed, it suffices to show that $A^c$ is open. That is, we must show $A^c=\{x\in M : f(x)<0 \}$ is open. Let $y\in A^c$. Then $f(y)<0$. Because $f$ is continuous, for any given $\epsilon>0$ there exists a $\delta$ (dependent on $\epsilon$) such that $|f(x)-f(y)|<\epsilon$ whenever $d(x,y)<\delta$ and $x\in M$. Let $\epsilon=\frac{f(y)}{2}$. Then there exists a $\delta^*$ such that $|f(x)-f(y)|<\frac{f(y)}{2}$ whenever $d(x,y)<\delta^*$ and $x\in M$. I claim that the $\delta^*$-neighborhood about $y$ is completely contained within $A^c$. Let $z\in N_{\delta^*}(y)$. Then $|f(z)-f(y)|<\frac{f(y)}{2}$, and thus $f(z)\in(f(y)-\frac{f(y)}{2},f(y)+\frac{f(y)}{2})\subset(\frac{3f(y)}{2},0)$, and thus $z\in A^c$. Thus, $A^c$ is open, and therefore $A$ is closed.

$(2) Proof:$ To show that $A$ is closed, it suffices to show that $A$ contains all of its limits points. Let $x$ be a limit point of $A$. Then for any $\delta>0$, $N_{\delta}^*(x) \cap A \neq \emptyset$. That is, there exists an element $r\in M$ such that $r\in N_{\delta}^*(x)$ and $r\in A$. Because $r\in N_{\delta}^*(x)$, we know $d(x,r)<\delta$. Because $r\in A$, we know $f(r)\geq 0$. Because $f$ is continuous, we can choose an appropriate $\delta$ such that $d(r,x)<\delta$ and $d(f(r),f(x))<\epsilon$ for any given $\epsilon>0$. If $f(r)>0$, then because the continuity of $f$ and the fact that $x$ is a limit point implies that $f(x)\geq 0$, and thus $x\in A$. If $f(r)=0$...?

I'm comfortable with proof 1 (but if you have any comments, see anything wrong with it, or think it can be made more concise, please speak up). However, as an exercise, I thought I would try and construct another proof. Proof 2 is that other proof. I've broken it down into two cases: $f(r)>0$ and $f(r)=0$. I'm stuck with the second case. Any suggestions?

-
Proof 1 is good! It's wordier than one usually expects, but I think that's appropriate for an introductory real analysis course- it's good to be careful. A small note though: You should not set $\epsilon = f(y)/2$, because $f(y)/2$ is a negative number(!) – Alex Zorn Mar 12 '13 at 5:23
Ah! Good point!! Instead I should choose $\epsilon=-\frac{f(y)}{2}$. – user31415926535 Mar 12 '13 at 5:27
You might consider using some displayed equations in your proofs, it helps to break things up and make your proofs appear less dense. – JSchlather Mar 12 '13 at 5:55

## 3 Answers

There is a problem with proof 2. You are picking an element $r$ within the neighborhood of radius $\delta$, then shrinking $\delta$ again to make it small enough to apply an appropriate continuity argument. Once you have picked $\delta$, you cannot choose to shrink it.

To see more clearly why this approach fails, suppose that we considered instead the set where $f(x) > 0$. Actually, let's take $f(x) = x^2$ and our metric space to be $\mathbb{R}$. Your attempted proof would show that $f(0) = 0^2 = 0 > 0$. How so? Around each neighborhood of $0$ there is a point $r$ for which $f(r) > 0$, and so by continuity just take $\delta$ small enough, etc. But now the flaw becomes more apparent! Suppose I take $\delta = 1/2$. Then I might have $r = 1/2$, and $f(r) = 1/4 > 0$. But the neighborhood where $f$ changes by less than $1/4$ must have $\delta < 1/2$, and so when we shrink to accommodate our new $\delta$, we lose $r$.

-
In the beginning, instead, I should have the sentence "Let $x$ be a limit point of $A$ and let $\epsilon>0$ be given." and then work with the $\delta$ that comes out of the continuity of $f$. Some of the other sentences will need to be rearranged, but that should fix things, yes? Thanks for the detailed example! – user31415926535 Mar 12 '13 at 5:42
No, that won't fix things. You don't know what $\epsilon$ to pick until you've found your $r$, the way you are doing this proof. And you can find your $r$ without picking $\delta$... – Isaac Solomon Mar 12 '13 at 5:44
... Let $x$ be a limit point in $A$ and let $\epsilon>0$ be given. Because $f$ is continuous, there exists a $\delta>0$ such that $|f(x)-f(y)|<\epsilon$ whenever $d(x,y)<\delta$ for any $y\in M$. Because $x$ is a limit point, $N_{\delta}^*\cap A\neq\emptyset$. That is, there exists an $r\in M$ such that $r\in N_{\delta}^*$ and $r\in A$. Thus $|f(x)-f(r)|<\epsilon$ and $f(r)\geq 0$. ... Will this not work? After this I would continue like @AlexZorn suggested. – user31415926535 Mar 12 '13 at 5:53
And what if $f(r) = 0$? Then you might have $f(x) = -\epsilon$. – Isaac Solomon Mar 12 '13 at 5:54

As for the additional proofs, you could also prove it as following:

1. Take a point $x$ from the closure of $A$. Hence there exists a sequence $(x_{n})_{n=1}^{\infty}\subseteq A$ so that $x_{n}\to x$. Since $f$ is continuous, then $f(x_{n})\to f(x)$, and since $f(x_{n})\geq 0$ for all $n$, then $f(x)\geq 0$. Hence $x\in A$. This shows that $A$ equals its closure and thus $A$ is closed.

2. Or alternatively, note that $A=f^{-1}[0,\infty)$, which is a closed set as the preimage of a closed set under a continuous function.

-

Proof 2 is good up almost until the end: "...for any given $\varepsilon > 0$." From there, you should finish the proof as follows:

Since $r \in A$, $f(r) \geq 0$, and it follows that $f(x) > f(r) - \varepsilon \geq -\varepsilon$. But $\varepsilon$ was arbitrary, and so this implies that $f(x) \geq 0$.

-