Prove that the integral $\int_1^\infty f(x)\, dx$ and series $\sum f(n)$ both converge or both diverge? If f is monotonic decreasing for all $x \ge 1$ and if $\lim \limits_{x \to +\infty}f(x) =0 $,
Prove that the integral $\int_1^\infty f(x)\,dx$ and series $\sum f(n)$ both converge or both diverge?
I try this exercise at 10.24 of book tom apostol's calculus like this:
Let $S_n=\sum f(n)$ and $T_n=\int_1^nf(x)\,dx$, since f is monotonic decreasing we can get
$$
S_n-S_1\le T_n \le \int_1^a f(t)\,dt \le T_{n+1} \le S_n \\
Where\, a \in [n,n+1]
$$
As $a \to +\infty$, $n \to +\infty$, so $\int_1^{\infty} f(x)\,dx$ same convergence or divergence as $T_n$ which also has same as $S_n$. So we have proved.
I am not sure what I have try is correct or not. Any help will be appreciated.

Since $f(x)$ is monotonically decreasing and tends to $0$, you can prove that $f(x)$ is not negative. To prove it by contradiction, we can assume the function is negative at a point $N$. Then we would have:
$f(N) = -c < 0 \implies -f(N) = c$
Where $c > 0$. Because $f$ is monotonically decreasing, we know that $\forall n > N. f(n) \le f(N) = -c < 0 \implies -f(n) \ge -f(N) = c$
From that:
$\forall \epsilon < c. \forall n > N. |f(n)| = -f(n) > \epsilon$
Which would contradict the assumption that $f$ tends to $0$, so $f$ has to be non-negative.
Then we can use the proof mentioned below, or a similar one to the integral test theorem ($10.11$), because $\int_n^x f(x) dx \to 0$, as $n, x \to \infty$.
