Proving that the maximum of two convex functions is also convex Here's a homework question I'm struggling with:

Let $f,g$ two convex functions. Prove that $h(x)=\max\{f(x),g(x)\}$ is
also convex

I don't know where to begin. The only thing I had in mind was was to try proving that if a function is convex on two sets $A$ and $B$, it is also convex on their union. That does not seem right though, for example, if I glue together $f(x)=x^2, g(x)=\frac{x^2}{1000}$ where $f$ is defined on $[0,1]$ and $g$ on $(1,2]$.
Anyway, that was the only thing I thought about. Any better ideas? thanks!
 A: Here is another way of seeing this.
First notice we can rewrite the maximum function as follows: $$\max(x,y) \,=\, \frac{x+y+|x-y|}{2}.$$ 
So if $f,g$ are convex functions, using the fact that the absolute value is a convex function and the fact that both the sum and the composition of convex functions is also a convex function, it is easy to see that $$h(x) \,=\, \max\big(f(x),g(x)\big) \,=\, \frac{f(x)+g(x)+|f(x)-g(x)|}{2}$$ is a convex function.
A: The hint of @Did solves the problem, but there is another proof, which is more intuitive I think.
A function is convex if and only if the area above its graph is convex. But then, the region above $h(x) = \max\{f(x),g(x)\}$ is the intersection of the area above $f$ and the region above $g$. Moreover, intersection of convex sets is convex, and that concludes the proof.
A: Hint: Use the characterization that $h$ is convex if and only if, for every $t$ in $[0,1]$ and every $(x,y)$, $h(tx+(1-t)y)\leqslant th(x)+(1-t)h(y)$.
Second hint: One wants to prove that $h(z)\leqslant th(x)+(1-t)h(y)$ where $z=tx+(1-t)y$. Since $h=\max\{f,g\}$, this is equivalent to the two inequalities
$$
f(z)\leqslant th(x)+(1-t)h(y),\qquad g(z)\leqslant th(x)+(1-t)h(y).
$$
Consider the first inequality. By convexity of $f$, one knows that $f(z)\leqslant tf(x)+(1-t)f(y)$. Furthermore, $f(x)\leqslant$ $____$ and $f(y)\leqslant$ $____$, hence...
