How $f(x)\le 0 \wedge f''(x)\ge 0 \implies f'(x)=0$? According to Exc. 23 Sec. 4.3 of the book Advanced Calculus by Fitzpatrick,

Let the function $f : \mathbb R \to \mathbb R$ have second derivatives and suppose that : $$ f(x)\le 0 \ \ \text{and} \ \ f''(x)\ge 0 , \ \ x \ \text{in} \ \mathbb R.$$ Prove that $f : \mathbb R \to \mathbb R$ is constant. 

It's easier to prove that $f'(x)= 0$ for all $x$ as it's logically equivalent to $f(x)= \text{const.}$. Well, of course $f'(x)$ is increasing. Nonetheless, $f'(x)$ can always remain negative even if it is strictly increasing. On the other hand, I can't find a counterexample; I tried $f'(x) = \tanh (x) -1 \le 0$, but it doesn't result in a contradiction as $f(x) = \ln \cos (x) - x$. Any idea?    
 A: Suppose there exists some $x_0$ such that $f'(x_0)\not=0$. There are two cases:

$(1)f'(x_0)>0$.  

In this case for all $x>x_0$ we have $f'(x)\geq f'(x_0)$, hence $f(x)\geq f'(x_0)(x-x_0)+f(x_0)$, which tends to $+\infty$ as $x\to+\infty$. A contradiction.

$(2)f'(x_0)<0$.

The same idea applies. For all $x<x_0$ we have $f'(x)\leq f'(x_0)$, hence $f(x)\geq f'(x_0)(x-x_0)+f(x_0)$, which tends to $+\infty$ as $x\to-\infty$.
A: By using Taylor's Theorem: $f(x)=f(x_0)+f'(x_0)(x-x_0)+\frac{1}{2}f''(\xi)(x-x_0)^2$, where $\xi$ between $x$ and $x_0$. If the right side is not a constant, then it is a polynomial function and it can not be always nonpositive. Hence we get the contradiction.
A: Do you know anything about convex functions? The condition $f''(x)\geq 0$ means that $f$ is convex on $\mathbb{R}$. Let Then $f$ must lie above its tangent at $x=x_0$ that is:
$$f(x)\geq f(x_0)+f'(x_0)(x-x_0)$$
for every $x$ and $y$. It's easy to see that the condition $f(x)\leq 0$ for every $x\in\mathbb{R}$ is not satisfied unless $f'(x_0)=0$.
A: Sketch of proof: Suppose, for a certain $q \in \mathbb{R}$, $f'(q) = a > 0$. Then, since $f''(q) \geq 0$, $f'(x) \geq a > 0$ for all $x \geq q$. (If it would go to $0$ again, $f'(x)$ had to descent somewhere, but $f''(q)\geq0$). Hence, we can draw a line $l$ through $(q,f(q))$ with slope $a$, and we know that $f(x)$ should be above that line all the time. Since $a \neq 0$, it is not parallel to the $x$-axis and will therefore eventually cross the $x$-axis to go above zero. This is a contradiction
The proof for $f'(q) < a$ works similarly, yielding $a$ must be zero.
A: I always like using Taylor's theorem to resolve questions of this kind (the information is about second derivative):
Fix any $x_0 \in \mathbb{R}^1$, by Taylor's theorem with Lagrange remainder, for any $x \in \mathbb{R}^1$,
\begin{align*}
f(x) = f(x_0) + f'(x_0)(x - x_0) + \frac{1}{2}f''(\xi)(x - x_0)^2 
\geq f(x_0) + f'(x_0)(x - x_0)
\end{align*}
since $f'' \geq 0$. The remaining argument as @Cave Johnson then finishes the proof.
A: $f"(x) >=0$   means slope is increasing everywhere or it is constant. 
$f'(x) $ can be negative constant, but that would mean $f(x) $ crossing x-axis somewhere. And that cannot happen.
Slope cannot be positive constant.
Slope cannot increase anywhere, because $ f"(x) >=0$ makes  $f(x)$ monotonically increasing. And that cannot happen.
So $f'(x) $ should be zero.
