If a function $f \in C^1$ with bounded derivative and $\int_{0}^{\infty}f$ converges then $f(x)\overset{x\rightarrow \infty}{\rightarrow}0$
I'm trying to prove this, intuitively, one might that f must go to zero otherwise the integral doesn't converge though it's incorrect. I thought about comparing in some domain the anti derivative with its derivative though I am not sure why should f converge.
Assume that $f$ did not go to $0$. Then, there exists an $\varepsilon>0$ and a sequence $(x_n)_{n\in \mathbb{N}}$ such that $x_n\to\infty$ and $|f(x_n)|\geq \varepsilon$. By thinning the sequence, the signs of $f(x_n)$ can be chosen equal so without loss of generality, $f(x_n)\geq \varepsilon$.
Let $M>0$ such that $|f'(x)|\leq M$ for all $x$ and note that $|f(x+\delta)-f(x)|\leq M\delta$ for all $\delta>0$ and $x\geq 0$ by the mean value theorem. Thus, we have that $f(y)\geq \frac{\varepsilon}{2}$ for all $y\in [x_n, x_n+\frac{\varepsilon}{2M}]$. Accordingly $$ \left|\int_0^{x_n+\frac{\varepsilon}{2M}} f(x)\textrm{d}x-\int_0^{x_n} f(x)\textrm{d}x\right|= \int_{x_n}^{x_n+\frac{\varepsilon}{2M}} f(x)\textrm{d}x\geq \frac{\varepsilon^2}{4M} $$
Thus, if $y_{2n-1}=x_n$ and $y_{2n}=x_n+\frac{\varepsilon}{2M}$, we get that $y_n\to \infty$ but $\left(\int_0^{y_n} f(x)\textrm{d}x\right)_{n\in \mathbb{N}}$ is not Cauchy, and thus, the integral is not convergent.