Showing a differentiable function satisfying $f(x) \le 0$ and $f''(x) \ge0$ for all $x$ is constant This is a problem from the book Advanced Calculus by Fitzpatrick
Let the function a real function $f$ have two derivatives and suppose that
$f(x) \le 0 $ and    $ f''(x) \ge0 $     for all $x$.
Prove that $f$ is constant (Hint: Observe that  $f'$ is increasing.)
I am not sure how to approach this problem at all. I tried using Mean Value theorem and Taylor's theorem. Intuitively I feel because f is concave up it must cross the x axis somewhere. But I am not sure how to use it as an argument.
Thanks
 A: Mean Value Theorem was a good idea! Suppose $f$ is not constant; then the Mean Value Theorem will show that there is a $f'$ is nonzero somewhere; say $f'(c) \neq 0$. If $f'(c) > 0$, then since $f'$ is increasing, $f'(x) \geq f'(c)$ for all $x > c$. Then integrate $f'(x)$ from $c$ to $c - \frac{f(c)}{f'(c)} + 1$ to show that $f(c - \frac{f(c)}{f'(c)} + 1)$ is positive. Similar argument for $f'(c) < 0$
A: Here's a trick I came up with. Take $f(x) = f(a) + f'(a) (x-a) + \frac{f''(c)}{2} (x-a)^2$. Then, $f(x) \leq 0$ implies that.
$\frac{f''(c)(x-a)^2}{2} \leq -f(a) - f'(a) (x-a)$ for any $x$. But we know that $f''(x) \geq 0$, so that $-f(a) - f'(a)(x-a)$ must always be greater than $0$ no matter what $x$ we take. But this is only possible if $f'(a)=0$. Repeat this procedure for any $a$. Thus, $f'(x)$ is always $0$.
A: This answer uses the hint given in question. 

Since $f''$ is non-negative it follows that $f' $ is increasing. Therefore $f'(x) $ tends to a limit or to $\infty$ as $x\to\infty$. By L'Hospital's Rule, $f(x)/x$ also does the same. Since $f(x)\leq 0$ it follows that $f'(x)$ tends to a non-positive number as $x\to\infty$. And since $f'$ is increasing it follows that $f'(x) \leq 0$ for all $x$. Thus $f$ is decreasing and since $f(x) \leq 0$ it follows that $f(x) \to L$ as $x\to-\infty$ where $L\leq 0$.
Next we note that as $x\to-\infty$ the derivative $f'(x) $ either tends to a limit or diverges to $-\infty$ and so does $f(x) /x$ via L'Hospital's Rule. Since $f(x) \to L$ the ratio $f(x) /x\to 0$ and hence $f'(x) \to 0$ as $x\to-\infty$. It now follows via increasing nature of $f'$ that $f'(x) \to 0$ as $x\to\infty$. It should be clear that $f'(x) =0$ for all $x$ and hence $f$ is a constant. 
A: Remark that $M=supf(x), x\in\mathbb{R}$ exists, suppose that there exists $x_0$ such that $f(x_0)=M$, $f'(x_0)=0$ let $x<x_0$, $f(x)-f(x_0)=f'(c)(x-x_0)$ where $c\in (x,x_0)$ whe deduce that $f'(c)\leq 0$ since $f'$ is increasing and $(x-x_0)f'(c)\geq 0$, but $f(x)-f(x_0)\leq 0$, we deduce that $f(x)=f(x_0)$
similar reasoning for $x\geq x_0$.
If there does not exists $x_0$ such that $f(x_0)=M$, you can find $x_0<y$ such that $f(x_0)<f(y)<M$, (or $f(y)<f(x_0)<M)$. 
Suppose that $f(x_0)<f(y)<M$ you deduce that $f(y)-f(x_0)=f'(c)(y-x_0)$ and $f'(c)>0$, this implies that for every $x>c$ $f'(x)>f'(c)$ and $lim_{x\rightarrow +\infty}f(x)=+\infty$ since for $x>c$,  $f(x)=f(c)+\int_{c}^xf'(t)dt\geq f(c)+(x-x_0)f'(c)$. Contradiction.
Suppose  $f(y)<f(x_0)<M$ $f(y)-f(x_0)=f'(c)(y-x_0)$ implies that $f'(c)<0$ since $f'$ decreases, $f'(x)<f'(c), x<c$, for $x<c$, $f(x)=f(c)+\int_c^xf'(t)dt\geq f(c)+(x-c)f'(c)$, it implies that $lim_{x\rightarrow -\infty}f(x)=+\infty$. Contradiction.
