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 ?
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.