$\int_a^\infty f(x) \, dx$ converges $\Rightarrow$ $\lim_{x\to \infty}f(x)=0$ $\int_a^\infty f(x) \, dx$ converges $\Rightarrow$ $\lim_{x\to \infty}f(x)=0$.
Give a proof or counterexample.(Assume $f(x)$ positive and continuous.)
I can show that $\int_R^{R'}f(x)\,dx \approx 0$ for $R,R'$ large. $f(c)(R'-R) \approx 0$ for some $c \in (R,R')$ by mean value theorem. Then I don't know how to prove.  

No. Let $\delta=\frac{1}{10}$. Consider a piecewise linear function $f:\mathbb{R}\rightarrow\mathbb{R}$
such that for each $n\in\mathbb{N}$, $f$ is linear on $[n-\delta2^{-n},n]$
with $f(n-\delta2^{-n})=0$, $f(n)=1$; $f$ is linear on $[n,n+\delta2^{-n}]$
with $f(n+\delta2^{-n})=0$; $f=0$ otherwise.
Clearly $f$ is continuous, non-negative and $\int_{a}^{\infty}f(x)dx<\infty$
for each $a\in\mathbb{R}$. However, $\lim_{x\rightarrow\infty}f(x)\neq0$
because $f(n)=1$ for each $n\in\mathbb{N}$.
