# T/F: if $\int_{1}^{\infty}f(x)dx$ converges then $\lim_{x\to\infty}f(x) = 0$. [duplicate]

I was asked to prove or disprove the following:

If $\int_{1}^{\infty}f(x)dx$ converges then $\lim_{x\to\infty}f(x) = 0$.

I said that this is false and gave this example:

$f(x) = \left\{ \begin{array}{ll} 1 & \mbox{if } x \in \mathbb{Q} \\ -1 & \mbox{if } x \notin \mathbb{Q} \end{array} \right.$

$\int_{1}^{\infty}f(x)dx = 0$ and $\lim_{x\to\infty}f(x)$ does not exist.

Was my example correct? And could anyone please elaborate more on this topic and write a little about how I should think in case I encounter similar T/F questions in the future?

## marked as duplicate by Strants, Lee David Chung Lin, Jyrki Lahtonen, Cesareo, blubApr 10 at 8:50

• Dirichlet function is not Riemann integrable – MathematicsStudent1122 Jun 18 '16 at 16:42
• Can you explain more? I was not told $f$ is continuous – Amir Jun 18 '16 at 16:45
• $f$ does not have to be continuous. But it must be integrable, obviously, otherwise the question makes no sense. – MathematicsStudent1122 Jun 18 '16 at 16:46
• @MathematicsStudent1122 I edited my post... Can you please explain why the function I provided is not Reimann integrable? – Amir Jun 18 '16 at 16:58
• Continuous example(s): en.wikipedia.org/wiki/Fresnel_integral – Winther Jun 18 '16 at 16:58

This is an old friend. If $f$ may be discontinuous, as a counterexample you can propose $$f(x) = \chi_{\{n \mid n \in \mathbb{N}\}}(x) = \begin{cases} 1 &\text{if x \in \mathbb{N}}\\ 0 &\text{otherwise}. \end{cases}$$ If you want a continuous counterxample, you must play with "bump" functions, for instance a function that is mostly zero but that has small bumps of smaller and smaller area.
• @JaneR You should try to construct a counterexample by yourself. Start from the discontinuous example above, and draw small triangle with one side on the $x$-axis. Now you should make these triangles smaller and smaller, so that the infinite sum of their areas is convergent. See also math.stackexchange.com/questions/85975/… – Siminore Jun 18 '16 at 17:09
The statement is false. See Fresnel-Integrals $$\int_{0}^{\infty}\cos(t^2)=\int_{0}^{\infty}\sin(t^2)=\frac{\sqrt{2a}}{4}$$