Is second derivative of a convex function convex? If $f$ is twice differentiable and convex, is it true that $f''$ is a convex function ?
 A: $f(x) = -\sin x$ in $(0,\pi/2)$ is a counterexample: $f''(x) = \sin x > 0 $for all $x \in (0,\pi/2)$ while $f''''(x) = - \sin x < 0$ for all $x \in (0,\pi/2)$
this should probably be the easiest non trivial example :)
A: I thought I'd take a personal challenge to find a counterexample on the entire real line. Here's a method for constructing such a function: let $g_1(x)$ be any nonconvex but positive real function such that the integrals $g_2(x)=\int_{0}^x g_1(z) dz$, and $g_3(x)=\int_{0}^x g_2(z) dz$ both exist for all $x\in\mathbb{R}$. Then $g_3$ is convex, but its second derivative $g_1$ is not.
If you'd like a specific example, consider 
$$f(x) = x \mathop{\textrm{erf}}(x) + \tfrac{1}{\sqrt{\pi}} e^{-x^2}$$
I chose this deliberately, because
$$f'(x) = \mathop{\textrm{erf}}(x), \quad
f''(x) = \tfrac{2}{\sqrt{\pi}} e^{-x^2}.$$
The function:

The second derivative:

A: A polynomial that works is $x^6-2x^5+5x^2$. The second derivative is $10(3x^4-4x^3+10)$, and is always $\ge 0$. But the fourth derivative is $120(3x^2-2x)$, which is negative in the interval $\left(0,\frac{2}{3}\right)$. 
A: Could you name a function that has continuous first and second derivative functions, has $ \ f'' > 0 \ $ everywhere, but for which $ \ f'' \ $ itself has zero curvature?  How about $ \ f(x) = x^2 \ $ ?
EDIT: It seems pretty hard to find (at least) an elementary function that is convex everywhere, for which the second derivative function is concave everywhere.  If you can be satisfied with just an interval, $ \ f(x) = -\arctan x \ $ for $ \ x > 0 \ $ is convex everywhere on the interval, but $ \ f''(x) \ $ is not.

A: integrate a positive function twice, then we get a convex function. So just find a non convex positive function is enough. Say, let $f''(x)=\sin(x)+1$, then $f(x)=x^2-\sin(x)$ is convex, but $f''$ is not.
A: Take any hyperbola that opens up. For example, consider the function
$$f(x) = \sqrt{1+x^2}$$
which looks like the absolute value function, but with the sharp point smoothed out. 

There is some finite curvature near the "pointy end" of the function at $x=0$, but the curvature goes to zero as one moves away in either direction towards $\pm \infty$. So, the second derivative looks like a "bump", which is not convex.
