TITLE: If $a_n=\int_n^{n+1} f,$ is it true that $f$ is Lebesgue integrable over $[1,\infty)$ if and only if the series $\sum_{n=1}^\infty a_n$ converges?
QUESTION [3 upvotes]: The following question is taken from Royden's Real Analysis $4$th edition, Chapter $4,$ question $29:$

Question: For a measurable function $f$ on $[1,\infty)$ which is bounded on bounded sets, define $a_n=\int_n^{n+1} f$ for each natural number $n.$
      Is it true that $f$ is Lebesgue integrable over $[1,\infty)$ if and only if the series $\sum_{n=1}^\infty a_n$ converges?Is it true that $f$ is Lebesgue integrable over $[1,\infty)$ if and only if the series $\sum_{n=1}^\infty a_n$ converges absolutely?

The same question was asked in MSE. However, the OP did not ask the first part of the question. So I am asking here.
My attempt: First statement is partial correct, as its converse is false. 
If $\sum_{n=1}^\infty a_n$ converges, then $f$ may not be integrable. 
    Let $f(x) = \frac{(-1)^n}{n}$ if $n\leq x<n+1.$
    Then $a_n = \frac{(-1)^n}{n}$ and therefore $\sum_{n=1}^\infty a_n$ converges (by Alternating Series Test) but $f$ is not integrable as 
    $$\int_1^\infty |f| = \sum_{n=1}^\infty\int_n^{n+1} |f|  = \sum_{n=1}^\infty \frac{1}{n}=\infty.$$
    However, if $f$ is integrable, then $\sum_{n=1}^\infty$ must converge, as 
    $$\sum_{n=1}^\infty a_n = \int_1^\infty f \leq \int_1^\infty |f| <\infty.$$ 
For second statement, I can only prove its sufficiency but have no idea on its necessity. 
If $f$ is integrable, then 
    $$\sum_{n=1}^\infty |a_n| = \sum_{n=1}^\infty \left| \int_n^{n+1} f  \right| \leq \sum_{n=1}^\infty \int_n^{n+1} |f| = \int_1^\infty |f|<\infty.$$
Can anyone check my proof and give some hints on necessity of second statement?

REPLY [5 votes]: If you take $f(x) = \sin(2\pi x)$ then $a_n \equiv 0$ and $\sum_{n=1}^\infty a_n$ converges absolutely but $f$ is neither improperly Riemann-integrable nor Lebesgue integrable.
The rest of your proof is fine.
{"set_name": "stack_exchange", "score": 3, "question_id": 2585664}