# Show the set $\{x \in M: f(x)<g(x)\}$ is an open set in metric space when $f,g$ are continuous

Let $$(M,d)$$ be a metric space and $$f,g:(M,d) \rightarrow \mathbb{R}$$ be continuous functions. Show the set $$A=\{x \in M: f(x) is an open set in $$(M,d)$$.

To show the statement we need to take a point $$x_0$$ and show that there exist a ball around $$x_0$$ which is contained in $$A$$. My proof is the following but it does not reasonable to me that I have to have the condition $$\epsilon_1>\epsilon_2$$.

Let $$x_0 \in A \rightarrow f(x_0)

Since $$f$$ is continuous $$\forall \epsilon_1>0\,\,\exists\,\,\,\delta_1>0\,\,\,\text{s.t.} \,\,\,d(x,x_0)<\delta_1 \,\,\,\rightarrow |f(x)-f(x_0)|<\epsilon_1$$ and $$-\epsilon_1

And since $$g$$ is continuous $$\forall \epsilon_2>0\,\,\exists\,\,\,\delta_2>0\,\,\,\text{s.t.} \,\,\,d(x,x_0)<\delta_2 \,\,\,\rightarrow |g(x)-g(x_0)|<\epsilon_2$$ and $$-\epsilon_2

let $$\delta=\min (\delta_1,\delta_2)$$ so using (1) and (2) $$f(x)-f(x_0)-\epsilon_2<\epsilon_1 +g(x)-g(x_0) \Rightarrow -\epsilon_2+\epsilon_1< g(x)-f(x)$$ Since $$f(x_0)-g(x_0)<0$$.

Therefore, if $$\epsilon_1>\epsilon_2 \Rightarrow 0< g(x)-f(x)$$ so $$d(x,x_0)<\delta$$ is contained in $$A$$.

Could you help me to get rid of this confusion. I understand that because $$f,g$$ are continuous those statement should be held for all $$\epsilon$$ but having this condition does not make sense to me.

• .... so using (1) and (2): how do you infer the next inequality (at that point in your text)? I do not see it. Nov 5 '18 at 6:24
• I summed over (1) and (2). Nov 5 '18 at 16:48

Your set is $$(g-f)^{-1}(]0,\infty[)$$

This is open, as inverse image of an open set under a continuous function.

Since you're not proving continuity, but using continuity, you want to pick a specific $$\epsilon$$.

Case in point: if $$f(x)=0, g(x)=x, x_0=1$$ and $$\epsilon=2$$, then your $$\delta$$ becomes $$2$$, and $$(-1,3)$$ is certainly not a subset of your set. So an arbitrary $$\epsilon$$ isn't going to do you any good.

I claim that $$\epsilon=\frac{g(x_0)-f(x_0)}2$$ works. Let $$\delta_f>0$$ be such that for any $$x_1\in M$$ with $$d(x_0,x_1)<\delta_f$$, we have $$|f(x_0)-f(x_1))|<\epsilon$$, and let $$\delta_g$$ be defined analogously. Pick $$\delta=\min\{\delta_f,\delta_g\}$$. Then, for any $$x_1\in M$$ with $$d(x_0,x_1)<\delta$$, we have $$f(x_0)+\frac{g(x_0)-f(x_0)}2=g(x_0)-\frac{g(x_0)-f(x_0)}2\\ f(x_0)+\epsilon=g(x_0)-\epsilon\\ f(x_1) where the first inequality is because $$d(x_0,x_1)<\delta_f$$ and the second one because $$f(x_0,x_1)<\delta_g$$.

• The result is true for any topological space $M$. Nov 5 '18 at 8:39
• @DanielWainfleet And the proof is much easier in a topological context. But, alas, we are given a metric space and the $\epsilon$-$\delta$ definition of continuity. Nov 5 '18 at 8:52
• @Arthur Actually, can we look at the proof if M was a generic topological space? I was thinking if $f$ and $g$ are continuous functions, $h(x) = (f - g)(x)$ is a continuous function. If $x_0 \in M$, and if I were to define an open neighborhood of $x_0$, $N(x,\epsilon)$, could we say that $h(N(x,\epsilon))$ is an open set that contains the interior point $x_0$? Jan 30 '20 at 5:01
• @Overachiever If $M$ were a generic topological space, we would have to discard the idea of $\varepsilon$-$\delta$ altogether. In that case, the function $h$ is continuous, so by definition of continuous (inverse image of any open is open), the set of points in $M$ where $h$ is strictly negative is open. So it's actually a lot easier. See the other answer. Jan 30 '20 at 7:10