limit of a $C^1$ is $0$ at $\infty$ Let $f:\mathbb{R}\to\mathbb{R}$, $f\in C^1(\mathbb{R})$. 
Suppose $\int_0^\infty f$ converges and $f'$ is bounded.
Prove that $\lim_{x\to\infty}f(x)=0$.
My attempt:
W.l.o.g. assume that $\lim_{x\to\infty}f(x)=L>0$.
from some point $x_0\in [0,\infty)$ we get that $f$ is positive then we can write:
$\int_0^\infty f$ = $\int_0^{x_0} f$ + $\int_{x_0}^\infty f$
$f'$ is bounded, thus $f$ is uniformly continuous in $[0,x_0]$ and the integral $\int_0^{x_0} f$ is equal to  $I$ for some $I$.
$\lim_{x\to\infty}\frac{f(x)}{1}=L>0$. And we get that $\int_{x_0}^\infty f$ and $\int_{x_0}^\infty 1$ converge and diverge together. 
$\int_{x_0}^\infty 1$ diverges, so $\int_{x_0}^\infty f$ diverges, too. contradiction.
 A: Since $I=\lim\limits_{x\to\infty}\int_0^x f(t)\,dt$ exists finite, you have $\limsup\limits_{x\to\infty} f(x)\ge0$ and $\liminf\limits_{x\to\infty} f(x)\le 0$.
Assume as a contradiction that $\limsup\limits_{x\to\infty} f(x)>0$. Since $\liminf\limits_{x\to\infty} f(x)\le 0$, you have that $f'(x)$ is negative in at least one point (actually, it must be frequently negative as $x\to\infty$). Therefore, $$A=\inf_{x> 0} f'(x)<0$$
Again, since $\liminf\limits_{x\to\infty} f(x)\le 0<\limsup\limits_{x\to\infty} f(x)$ and $f$ is continuous, there is a positive real number $M$ such that $f(x)=M$ frequently often as $x\to\infty$. Id est, there is a sequence $x_n\to\infty$ such that $f(x_n)=M$.
By Lagrange theorem, $$\begin{align}&f(x)\ge A(x-x_n)+M&\text{if }x>x_n\\\end{align}$$
A fortiori, this holds for $x_n< x<x_n-\frac{M}{A}$
Hence, $$\int_{x_n}^{x_n-\frac MA}f(t)\,dt\ge \left[\frac A2t^2+(M-Ax_n)t\right]^{x_n-\frac MA}_{x_n}=-\frac{M^2}{2A}$$
But $x_n-\frac MA\stackrel{n\to\infty}\longrightarrow \infty$ and $$\liminf\limits_{n\to\infty}\int_0^{x_n-\frac MA}f(t)\,dt=\liminf\limits_{n\to\infty}\left(\int_0^{x_n}f(t)\,dt+\int_{x_n}^{x_n-\frac MA}f(t)\,dt\right)=\\=\lim\limits_{n\to\infty}\int_0^{x_n}f(t)\,dt+\liminf\limits_{n\to\infty}\int_{x_n}^{x_n-\frac MA}f(t)\,dt\ge I-\frac{M^2}{2A}>I$$
Which contradicts $\lim\limits_{x\to\infty} \int_0^x f(t)\,dt=I$. Therefore it must hold $\limsup\limits_{x\to \infty}f(x)\le0$ and, hence, $=0$.
Now, by using the previous result on $g=-f$ (which satisfies the hypothesis of the theorem), we obtain that $$0\ge\limsup\limits_{x\to\infty} g(x)=-\liminf\limits_{x\to\infty} f(x)$$
So $\liminf\limits_{x\to\infty}f(x)\ge 0$ as well. Hence $\liminf\limits_{x\to\infty} f(x)=0$.
This proves that $\lim\limits_{x\to\infty} f(x)=0$.
