TITLE: Uniformly continuous and integrable function $f:[0,\infty)\to (0,\infty)$ with $\lim_{t\to\infty}f(t)=C$ satisfies $\sum_{n=1}^\infty f(n)=\infty$
QUESTION [6 upvotes]: Let $f:[0,\infty)\to (0,\infty)$ be a uniformly continuous function with $\lim_{t\to\infty}f(t)=C.$
Prove that $\int_0^\infty f(t)dt=\infty$ $\Longleftrightarrow$ $\sum_{n=1}^\infty f(n)=\infty$.

My attempt
For the case $C>0$, I can prove that both $\int_0^\infty f(t)dt=\infty$ and $\sum_{n=1}^\infty f(n)=\infty$ hold. The difficulty is in the case that $C=0$ and I got stuck. Any helps would be highly appreciated!

REPLY [2 votes]: As suggested by @Claudio Moneo, this isn't true all time.
But making some changes in conditions of statement we can derive some analogous case to this.
Let $f$ be a continuous function such that,
$$f:[0,\infty)\rightarrow (0,\infty)$$
$$\lim_{n\to\infty}nf(n)= A$$
$f'(x)$ exists
And if
$$\int_{0}^{\infty}f(t)dt$$ diverges
Then all these conditions imply that,
$$\sum_{n\in\mathbb{N}}f(n)\rightarrow \infty$$
$\textbf{PROOF}:-$
This is a direct result obtained via partial summation.
Consider the integral,
$$\int_{0}^{\infty}f(x)dx$$
Which diverges by our conditions.
Integration by parts yields,
$$[f(x)]_{x\to\infty}-[f(x)]_{x\to 0}-\int_{0}^{\infty}xf'(x)dx$$
As per the conditions above the limit $\lim_{x\to\infty}xf(x)$ converges. And $\lim_{x\to 0}xf(x)$ is $0$ because $f(0)$ converges. So coming to integral, Abel summation converts the integral to summation,
$$\int_{0}^{\infty}xf'(x)dx=\sum_{n\ge 1}A(n-1)f(n)-\sum_{n\ge 1}A(n)f(n)$$,
Where, $A(u)=\sum_{n\le u, n\in\mathbb{N}}1$.
Combining the both sums because they are between same bounds leads to,
$$-\sum_{n\ge 1}f(n)$$.
Placing this in place of that integrand leads to,
$$A-\int_{0}^{\infty}xf'(x)dx=A+\sum_{n\ge 1}f(n)$$
Now since the integral diverges,
$\sum_{n\ge 1}f(n)$ also diverges.
If we proceed in the reverse, we may also prove that the converse also holds.