The assignment:
Let $(a_n)_{n\in\mathbb{N}}$ be a sequence of real numbers and $f: [1, \infty) \rightarrow \mathbb{R}$ be a function, defined by $f(x) = a_n$, for $x \in [n,n+1).$ Show that: $$\lim_{b\to\infty} \int_1^b f(x) \ dx $$ exists if and only if $$\sum_{n=1}^\infty a_n$$converges. Similarly show that the equivalence also holds for the absolute improper integral and that if we have convergence the equality $\int_1^\infty f(x) \ dx = \sum_1^\infty a_n$ is true.
I think the comparison tests for both series and integrals might be helpful but I don't know which inequality to use to get from the series to the integral and vice versa, since I need either two integrals or two series to use a comparison test.
Any help would be appreciated.