# Example of functions $f$ and $g$ such that $g \circ f$ is not convex

If $f$ and $g$ are strictly convex and $f$ is increasing, I know that $f\circ g$ is strictly convex.

What would be an example of a function where $g\circ f$ is not strictly convex though...

I first thought of $f(x)=-x$ and $g(x)=x^2$, and then realized that $f$ and $g$ both have to be strictly convex as well. Now, I don't have any idea how to approach this.

-
Doesn't $f(x) = -x$ violate the hypothesis that $f$ is increasing? – Srivatsan Nov 13 '11 at 20:56
I am not sure I understand the question completely, but anyway.... Would choosing one of the two function constant give an example of what you're looking for? – Martin Sleziak Nov 13 '11 at 21:04
@Srivatsan Yup, haha another reason why it shouldn't work... – MathMathCookie Nov 13 '11 at 21:16

## 1 Answer

I believe you are asking for an example of two smooth functions, $f$ and $g$, where $f''$, $g''$, and $f'$ are positive over their domains, and yet $(g\circ f)''$ is not positive over its entire domain.

In that case, a look at the second derivative of $g\circ f$: \begin{align*} (g\circ f)'' &= (g''\circ f)(f')^2+(g'\circ f)f'' \end{align*}

shows us that $g'$ must be negative. The simplest example of a function $g$ meeting the given conditions that I can think of is given by $g(x)=\mathrm{e}^{-x}$. The simplest $f$ that I can think of with the given conditions is given by $f(x)=x^2$. And indeed, with these choices \begin{align*} (g\circ f)'' &= (4x^2-1)\mathrm{e}^{-x^2} \end{align*} which is not always positive.

-