If $\int_0^\infty f\text{d}x$ exists, does $\lim_{x\to\infty}f(x)=0$? Are there examples of functions $f$ such that $\int_0^\infty f\text{d}x$ exists, but $\lim_{x\to\infty}f(x)\neq 0$?
I curious because I know for infinite series, if $a_n\not\to 0$, then $\sum a_n$ diverges. I'm wondering if there is something similar for improper integrals.

If $\lim_{x\to+\infty}f(x)=l>0$, then $\exists M>0:l-\varepsilon<f(x)<l+\varepsilon\quad \forall x>M$, and so
$$
\int_M^{+\infty}f(x)dx>\int_M^{+\infty}(l-\varepsilon)dx=+\infty
$$
if $\varepsilon$ is sufficiently small.
