TITLE: The composition of two convex functions is convex
QUESTION [32 upvotes]: Let $f$ be a convex function on a convex domain $\Omega$ and $g$ a convex non-decreasing function on $\mathbb{R}$. prove that the composition of $g(f)$ is convex on $\Omega$. Under what conditions is $g(f)$ strictly convex.
My attempt, since $f$ is convex, $$f([1-t]x_0 +ty_0)\le [1-t]f(x_0) + tf(y_0)\:,\quad
 t \in [0,1] 
\,\text{and} \: x_0,y_0\in \Omega$$
 Since $g$ is convex $$g([1-s]x_1 +sy_1) \le [1-s]g(x_1) + sg(y_1)\:,\quad s \in [0,1]\:and \: x_1,y_1 \in \mathbb{R}$$
 So $$g([1-s]f([1-t]x_2 +ty_2) +sf([1-t]x_2 +ty_2)) \\\le [1-s]g([1-t]f(x_2) + tf(y_2)) + sg([1-t]f(x_3) + tf(y_3))\: for\:x_2,y_2,x_3,y_3 \in \Omega.$$ Im not sure if this is always true.
Any help would be appreciated. 
Thanks

REPLY [44 votes]: We want to prove that for $x, y \in \Omega$, $(g \circ f)\left(\lambda x + (1 - \lambda) y\right) \le \lambda (g \circ f)(x) + (1 - \lambda)(g \circ f)(y)$.
We have:
\begin{align}
(g \circ f)\left(\lambda x + (1 - \lambda) y\right) &= g\left(f\left(\lambda x + (1 - \lambda) y\right)\right) \\
&\le g\left(\lambda f(x) + (1 - \lambda) f(y)\right) & \text{(} f \text{ convex and } g \text{ nondecreasing)} \\
&\le \lambda g(f(x)) + (1 - \lambda)g(f(y)) & \text{(} g \text{ convex)} \\
&= \lambda (g \circ f)(x) + (1 - \lambda)(g \circ f)(y)
\end{align}