Continuity of $\max$ function

What I would do is this: $$ \max(f(x),g(x))=g(x)+\max(f(x)-g(x),0), $$ so this reduces us to write an expression for $\max(f(x),0)$. If we write $f=f^+-f^-$ (positive and negative parts), we have $\max(f(x),0)=f^+(x)$. We also have $|f|=f^++f^-$, so $f^+=(f+|f|)/2$. In the end, $$ \max(f(x),0)=\frac{f(x)+|f(x)|}2. $$ If we now go back to the initial case, \begin{align} \max(f(x),g(x))&=g(x)+\max(f(x)-g(x),0)\\ \ \\ &=g(x)+\frac{f(x)-g(x)+|f(x)-g(x)|}2\\ \ \\ &=\frac{f(x)+g(x)+|f(x)-g(x)|}2 \end{align}


The following is an "abstract nonsense" answer to your question.

Given two real numbers $a$ and $b$ there is a quadratic equation having these two numbers as solutions, namely $$(x-a)(x-b)=x^2-p x + q =0\ ,$$ where $p=a+b$ and $q=ab$. The two coefficients $p$ and $q$ encode the multiset $\{a,b\}$ in a reversible way, insofar as we can write $$\{a,b\}=\left\{{p-\sqrt{p^2-4q}\over2},{p+\sqrt{p^2-4q}\over2}\right\}\ .$$ Now on the right side the two numbers appear in increasing order. Therefore $$\max\{a,b\}={1\over2}\left(p+\sqrt{p^2-4q}\right)={1\over2}\bigl(a+b+|a-b|\bigr)\ .$$


I think I'd start by considering the easier case where one of $f$, $g$ was constant and zero. If I've proved that $\max(h(x),0)$ is continuous for all continuous $h$ and want to generalise, I'll see that I can write $$\max(f(x),g(x)) = \max (f(x)-g(x), 0) + g(x).$$ This formula breaks the symmetry between $f$ and $g$ that we started with, so it's natural also to write down $$max(f(x), g(x) = \max( g(x)-f(x), 0) + f(x) $$ and we recover the symmetry by adding the two expressions up: $$2 max (f(x),g(x)) = f(x) + g(x) +\left(\max (f(x)-g(x), 0) + \max( g(x)-f(x), 0)\right).$$ And now the expression inside the bracket looks familiar, being exactly $|f(x)-g(x)|$.

Indeed you really have to break up $|f(x)|$ into these two parts to prove that the absolute value of a continuous function is continuous. So the magic formula doesn't really make for a shortcut in the proof, even if you're told about it without motivation.