What is composition of convex and concave function?

Suppose that $f: \mathbb{R}\to \mathbb{R}$ is convex function and $g: \mathbb{R}\to \mathbb{R}$ is concave function. What can we say about their composition $g\circ f$ and $f\circ g$? Are they convex or concave functions?

Thank you in advace !


Solution 1:

Hint. Try $f(x)=e^x$ (convex) and $g(x)=-x^2$ (concave).

What about $f(g(x))=e^{-x^2}$? Is it convex or concave? Check the plot at WA.

P. S. If we assume that $f,g$ are $C^2$ then $$(f(g(x))'=f'(g(x))\cdot g'(x),\quad (f(g(x))''=f''(g(x))\cdot (g'(x))^2+f'(g(x))\cdot g''(x)$$ So if $f''\geq 0$, $g''\leq 0$ and $f'\leq 0$ then $(f(g(x))''\geq 0$.