If $f$ and $g$ are both uniformly continuous, show that $\max(f, g)$ is uniformly continuous My friend asked me this question and I gave him a sketch of proof. My idea is that to construct a function
$$h = \begin{cases}
f-g & \textrm{if $f \ge g$}\\
0 & \textrm{if $f < g$}
\end{cases}$$
and show that $h$ is uniformly continuous. Then since $\max(f, g) = g + h$, so it is uniformly continuous.
He believed that I oversimplified, and show me this site: http://www.math.unm.edu/~crisp/courses/math402/sol-hw5.pdf
The proof of this statement is on the second page. I completely don't see why the third (and fourth) case should be consider, since there is a theorem that for a continuous function $f$, if $f(x_0) > 0$, then there exist a nbhd $U(x_0)$ of $x_0$ s.t. $f(x) > 0$ for all $x \in U(x_0)$. In other words, I can just consider the nbhd s.t. $f(x) > g(x)$ if $f(x_0) > g(x_0)$. For a larger $\epsilon$, I can simply maintain the $\delta$ and everything is fine.
So my questions are:


*

*Is my sketch correct?

*Why do we need to consider 4 cases as shown in the "answer"?


It is much simpler if you use the formula (proved here)
$$\max(f, g) = \frac{1}{2}\left(f + g + |f - g| \right)$$ and then we can reason in the following manner. Sum and difference of two uniformly continuous functions is uniformly continuous. Hence both $(f + g)$ and $(f - g)$ are also uniformly continuous. If we note the inequality $||a| - |b|| \leq |a - b|$, then we get that modulus of an uniformly continuous function is also uniformly continuous. Hence $|f - g|$ is uniformly continuous. By sum property $h = (f + g + |f - g|)/2$ is also uniformly continuous.
