# Positive twice differential decreasing function, is it convex?

If g is a positive, twice differentiable function that is decreasing and has limit zero at infinity, does g have to be convex? I am sure, from drawing a graph of a function which starts off as being concave and then becomes convex from a point on, that g does not have to be convex, but can someone show me an example of an actual functional form that satisfies this property?

We know that since g has limit at infinity, g cannot be concave, but I am sure that there is a functional example of a function g:[0,∞)↦(0,∞) which is increasing, has limit zero at infinity, and is not everywhere convex, I just can't come up with it. Any ideas?

Thank you!

-
$g(x) = e^{-x^2}$ on $x \geq 0$. – cardinal Jul 7 '12 at 23:43

Since the functions mentioned so far are eventually convex, here is one more: $$f(x)=e^{-x}(3+2\sin x)$$ The first derivative $$f\,'(x)=e^{-x}(2\cos x-2\sin x-3)$$ is always negative because $\cos x-\sin x\le \sqrt{2}$ for all $x$. But the second derivative $$f\,''(x)=e^{-x}(3-4\cos x)$$ changes sign infinitely many times.
Try $$f(x)=\frac{\pi}2-\tan^{-1}x\;.$$