Let $f:[0,\infty)\to (0,\infty)$ be a continuous function and $\displaystyle\int^{\infty}_{0}f<\infty$. Show that $f$ is uniform continuous iff $\displaystyle\lim_{x\to \infty}f(x)=0$
So I could only see that continuity is not sufficient condition for the limit to exists since $\displaystyle\int^{\infty}_{0} \cos x^2$ exists but $\displaystyle\lim_{x\to \infty}\cos x^2$ does not exist , so we need something more stronger than continuity.
Hint: If $f$ does not approach zero at infinity, there is an $\varepsilon>0$ and a sequence $x_n\to\infty$ so that $f(x_n)>2\varepsilon$ for each $n$. If $f$ is uniformly continuous, there is $\delta>0$ so that $|x-y|<\delta$ implies $|f(x|-f(y)|<\varepsilon$. Now look at what that says about $f$ near the points $x_n$.
Edit: I should say something about the reverse direction. Assume $f\to0$ at infinity. If $\varepsilon>0$ is given, that means there is $M$ so that $x>M$ implies $f(x)<\varepsilon$. Now use the uniform continuity of $f$ on the compact interval $[0,M]$.