# If $f,g$ are continuous at $a$ and $f(a)<g(a)$, then $f(x)<g(x)$ for $\left|x-a\right|<\delta$

If $$f,g\colon X\to \mathbb{R}$$ are continuous at $$a \in X$$ and $$f(a), then there is a $$\delta>0$$ such that $$f(x) for all $$x\in X$$ with $$\left|x-a\right|<\delta$$.

If $$f$$ and $$g$$ are continuous at $$a\in X$$, then for all $$\varepsilon>0$$ there is a $$\delta_f>0$$ and a $$\delta_g>0$$ such that for all $$x\in X$$ we have

$$\left|x-a\right|<\delta_f\implies \left|f(x)-f(a)\right|<\varepsilon$$ as well as $$\left|x-a\right|<\delta_g\implies \left|g(x)-g(a)\right|<\varepsilon$$

Choose $$\varepsilon=g(a)-f(a)$$, there there'll be $$\delta_f,\delta_g>0$$ and let's define $$\delta=\min{(\delta_f,\delta_g)}$$.

Then we'll have for all $$x\in X$$ that $$\left|x-a\right|<\delta\implies \left|g(x)-g(a)\right|<\varepsilon \ \text{and}\ \left|f(x)-f(a)\right|<\varepsilon$$

Since $$\varepsilon=g(a)-f(a)$$, we have

$$\left|g(x)-g(a)\right|

and

$$\left|f(x)-f(a)\right|

But from now I don't really know how to arrive at $$f(x), as $$f(a) and $$f(x) don't really imply much.

• Take $\varepsilon=\frac 12(g(a)-f(a))$ instead. – August Liu Nov 17 '20 at 15:18

You can simplify a lot the proof by denoting $$h(x) = g(x) - f(x)$$. You have $$h(a) >0$$ and have to prove that $$h(x) >0$$ in a neighborhood of $$a$$.
By continuity of $$h$$ at $$a$$, it exists $$\delta > 0$$ such that $$\vert h(x) -h(a)\vert < \frac{ h(a) }{2}$$ for $$\vert x-a \vert < \delta$$.
As $$\vert h(x) -h(a)\vert < \frac{ h(a) }{2}$$ implies $$h(x) > \frac{h(a)}{2} >0$$, you're done.