Why $\max\{f,g\}$ is continuous if $f$ and $g$ are continuous? Let $f,g:\mathbb{R}\to \mathbb{R}$ be continuous functions. I need to prove that $x\mapsto \max\{f(x),g(x)\}$ is continuous without using the fact that $\max\{a,b\}=\frac{a+b+|a-b|}{2}$.
Let $\varepsilon >0$ and $a\in\mathbb{R}$. Suppose, without loss of generality, that $f(a)\leq g(a)$. There is $\delta >0$ such that $|f(x)-f(a)|<\varepsilon $ and $|g(x)-g(a)|<\varepsilon $ when $|x-a|<\delta $. I'm trying to prove that $$\lvert\max\{f(x),g(x)\}-g(a)\rvert<\varepsilon,$$
but I really have problems. I know that $\max\{f(x),g(x)\}=f(x)$ or $g(x)$, and thus $$\lvert\max\{f(x),g(x)\}-g(a)\rvert=\begin{cases}|f(x)-g(a)|\\ \text{or} \\ |g(x)-g(a)|\end{cases},$$
but I can't write it down rigorously since the fact that $\max\{f(x),g(x)\}=f(x)$ or $g(x)$ depend on $x$.

Rather straightforward:
Let $\epsilon$ be given
For $\epsilon/2$  there are  $\delta_{1,2}$ s.t.
$|x-x_0| < \delta = \min \delta_{1,2}$ implies
$|f(x)-f(x_0)| < \epsilon/2$ , and $|g(x)-g(x_0)| < \epsilon/2$.
Then 
$|x-x_0| \lt \delta$ implies
$(1/2)|f(x)+g(x)+|f(x)-g(x)|- f(x_0)-g(x_0)-|f(x_0-g(x_0)|| $
$\le (1/2)|f(x)-f(x_0)| +$
$(1/2)|g(x)-g(x_0)| +$
$(1/2)||f(x)-g(x)| -$
$|f(x_0)-g(x_0)||$
$\le (1/2)(\epsilon/2) +(1/2)(\epsilon/2) + (1/2)|(f(x)-g(x))-(f(x_0)-g(x_0))| $
$\le \epsilon/2 + (1/2)|f(x)-f(x_0)| +(1/2)|g(x)-g(x_0)| \lt  \epsilon.$
Used: Continuity of $f,g$; triangle inequality, reverse triangle inequality.
