$f:[a,\infty[\to \mathbb{R},0< a\leq 1$ continuous, let $a_n = f(n)$. Show that $\sum_{n=1}^{\infty} a_n$ is convergent iff $\int^{\infty}_{a}f(x)dx$ is convergent.
My notation: $P = \bigcup_{i=0}^n ]t_{i-1},t_i[$ a partition of $[a,\infty[$
$m_i=\inf\{f(u)|u\in [a,\infty[\}$
$M_i=\sup\{f(u)|u\in [a,\infty[\}$
$s(f,P)=\sum_{i=0}^n m_i(t_i-t_{i-1})$
$S(f,P)=\sum_{i=0}^n M_i(t_i-t_{i-1})$
The integral I'm using is Riemann's integral. My idea was to consider a partition $P = \bigcup I_i$ of $[a,\infty[$ such that $|I_i|=1$, that way $\sum_{n=1}^\infty f(n)\leq S(f,P)$, so I could use that to make the integral be bounded by some expression with the series.
The problem is the integral might be greater than the series, and then I don't know how to bound it. Is this attempt going to lead to any results or is there another way to prove this convergence? And if this way is good, can anyone hint me a way to bound the integral?
Edit: Thanks to @Openball I know that f also must be decreasing and not negative. In the case it is decreasing and not negative, any ideas?
My line of thought now was:
Suppose $\sum_{n=1}^\infty f(n)=A \in \mathbb{R}$.
Now $\int_1^\infty f(x) dx = \lim_{u \to \infty} F(u)-F(1)$.
$\phi(u) = F(u)-F(1) = \sum_{i=1}^{u-1}F(i+1)-F(i)$.
$\phi'(u) = F'(u)-F'(1) = \sum_{i=1}^{u-1}F'(i+1)-F'(i)$
but then I lost myself again. Any ideas or somewhere I can find this demonstration?