Prove $f$ is uniformly continuous iff $\lim_{x\to \infty}f(x)=0$ [duplicate]

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.

marked as duplicate by Jonas Meyer real-analysis StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Apr 1 '15 at 14:20

• You need some condition at $0$ for this to be true! – PhoemueX Sep 14 '14 at 17:15
• the problem has no more conditions. – Bhauryal Sep 14 '14 at 17:15
• Then the problem is wrong. It can indeed be repaired as @Omnomnomnom suggests. – Harald Hanche-Olsen Sep 14 '14 at 17:17
• Yes, $f(x)=1/(\sqrt x+x^2)$ for example. – Harald Hanche-Olsen Sep 14 '14 at 17:19
• @JonasMeyer It's supposed to be positive. $(1+\sin(1/x))/(1+x^2)$ will work. – Harald Hanche-Olsen Sep 14 '14 at 17:21

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]$.
• It says that $f(x)>\varepsilon$ near those points. (Note my careful use of $2\varepsilon$ earlier, which helps to make this work.) Now quantify “near”, and figure out what that says about the integral. – Harald Hanche-Olsen Sep 14 '14 at 18:17
When $f$ is merely continuous, we can make $f$ be a sequence of disjoint triangles of a fixed height, say $1$, and a decaying width, say $1/(2n^2)$. Then the integral of $f$ is $\sum_{n=1}^\infty 1/(4n^2)<\infty$, but there are arbitrarily large points where $f$ is $1$. We can make this even worse; for example we can make the heights $n$ and the widths $1/(2n^3)$, and then $f$ isn't even bounded. We can repeat this argument with your constraint that the codomain is $(0,\infty)$ in a number of ways. For example, we can make the $n$th triangle start at $1/(2n^2)$, rise to $1$, then fall to $1/(2(n+1)^2)$, then stay there until the $(n+1)$th triangle begins to rise, etc.
The problem here is that the triangles are allowed to shrink in width even as they stay the same size in height. When $f$ is uniformly continuous, this is impossible: if there are arbitrarily large points where $f>\varepsilon$, then there are infinitely many disjoint intervals of a fixed width $\delta$ where $f>\varepsilon/2$. From this we conclude $\int_0^\infty f(x) dx \geq \sum_{n=1}^\infty \varepsilon \delta/2 = \infty$.