# concavity of function composition

Suppose we have functions $f$ and $g$ that are both concave upward and that both have a continuous and nonzero second derivative at every point. Is there any restriction required on $f$ such that $f \circ g$ is concave upward?

Concave upward means that $f''(x)>0$ and $g''(x)>0$ for all $x$. I can't think of an example where the composition of 2 such functions doesn't give a concave upward function. What am I missing?

-

Observe that $$(f\circ g)''(x)=f''(g(x))(g'(x))^2+f'(g(x))g''(x).$$ Thus, if $f'(x)>0$ for all $x$, then $(g\circ f)''(x)>0$.