$f: \mathbb R \to [0, \infty ) $ be a twice differentiable function with $f'' \le 0 $ , then how to show that $f$ is constant ? Let $f: \mathbb R \to [0, \infty ) $ be a twice differentiable function with $f''(x) \le 0 , \forall x\in \mathbb R $ , then how to show that $f$ is constant ? 
My work:- Consider arbitrary $x\in \mathbb R$ and fix it , then for any $t \in \mathbb R$ , Taylor gives $0\le f(x+t)=f(x)+tf'(x)+\dfrac{t^2}2f''(c) \le f(x)+tf'(x)$ so $f'(x) \ge -\dfrac{f(x)}t , \forall t\in \mathbb R^+$ , thus letting $t \to \infty$ , we get $f'(x) \ge 0 , \forall x \in \mathbb R$ , now since $f'' \le0$ , so $f'$ is decreasing , thus $0\le f'(x) \le f'(z) , \forall z \in (-\infty , x] $ , so if we can show that $\lim_{z \to -\infty} f'(z)$ exists then we are done , because then by L'Hospital's rule we would have $\lim_{z \to -\infty} f'(z)=\lim_{z \to -\infty} \dfrac{f(z)}z \le 0$ (because $f \ge 0$ ) , but due to $f' \ge0$ , we have $\lim_{z \to -\infty} f'(z) \ge 0$ , thus $\lim_{z \to -\infty} f'(z)=0$ and then from $0\le f'(x) \le f'(z) , \forall z \in (-\infty , x] $ we can conclude $f'(x)=0 , \forall x \in \mathbb R$ concluding our proof ; but I cannot show that $\lim_{z \to -\infty} f'(z)$ exists at all ; am I even in the right direction ? 
 A: This can be simplified. Assume by contradiction that $f'$ is not zero everywhere, then there exists $x$ such that $f'(x)\ne0$.


*

*If $f'(x)\gt0$, then $f''\leqslant0$ hence $f'\geqslant f'(x)$ on $(-\infty,x]$, in particular, by the MVT, for every $y\leqslant x$, $f(x)-f(y)\geqslant f'(x)(x-y)$, that is, $f(y)\leqslant f'(x)y+f(x)-f'(x)x$. When $y\to-\infty$, the RHS becomes negative, this is a contradiction since $f\geqslant0$ everywhere.

*If $f'(x)\lt0$, then $f''\leqslant0$ hence $f'$ $__$ $f'(x)$ on $[x,+\infty)$, in particular, by the MVT, for every $y\geqslant x$, $f(y)-f(x)$ $__$ $f'(x)(y-x)$, that is, $f(y)\leqslant f'(x)y+f(x)-f'(x)x$. When $y\to+\infty$, the RHS becomes negative, this is a contradiction since $f\geqslant0$ everywhere.
Finally, $f'=0$ identically, hence $f$ is constant.
A: The convexity condition $f''(x) \le 0$ means that $f$ lies below all of its tangent lines. If $f$ is not constant, then it must have non-zero derivative at some point. The tangent line to $f$ at this point has non-zero slope and thus must cross the $x$-axis, and thus $f$ must too, contradicting $f \ge 0$.
A more rigorous proof would probably be easily found by applying the mean value theorem to $f'$.
A: When $f$ is not constant, after some preliminary changes (translation, replacing $x$ by $-x$ if necessary) we may assume $c:=f'(0)<0$. It follows that
$$\eqalign{f(x)&=\int_0^x f'(t)\>dt= (t-x)f'(t)\biggr|_0^x-\int_0^x (t-x)f''(t)\>dt\cr &=x f'(0)+\int_0^x(x-t)f''(t)\>dt\leq c\>x\qquad(x\geq0)\ .\cr}$$
Here the right hand side becomes very negative when $x\to\infty$.
