$\forall a > 0$ $\sum_{n=1}^{\infty} f(na)$ is convergent. Prove that $\int_{0}^{\infty}f(x) dx$ is convergent. Hi can you help me solve this exercise? Thanks. Let $f: [0;+\infty) \to \mathbb{R}$ be nonnegative and continuous function. Suppose $\forall a > 0$ $\sum_{n=1}^{\infty} f(na)$ is convergent. Prove that $\int_{0}^{\infty}f(x) dx$ is convergent. I tried to solve it by using the Riemann sum, but for fixed a it doesn't work. I have no other ideas.
 A: *

*
Let $f$ be a non-negative function such that there exists numbers $a<b$ verifying 
  $$\tag{*}\sum_{n=1}^{+\infty}\frac 1n\int_{an}^{bn}f(u)du<+\infty.   $$
  Then $\int_{0}^{+\infty}f(u)du$ is finite. 

Indeed, without loss of generality, assume that $a=1$ (do the substitution $at=u$ and replace $f$ by $x\mapsto f(ax)$). Pick a number $c$ such that $1<c^2<b$ and define $c_N:=\left[c^N\right]$. Then 
$$b\left(c_N+1\right)>bc^N>c^{N+2}\geqslant c_{N+2}.$$
In the series involved in (*), cut the index of summation according to $c_N+1\leqslant n\leqslant c_{N+1}$ in order to get 
$$ 
\sum_{n=1}^{+\infty}\frac 1n\int_{n}^{bn}f(u)du\geqslant \sum_{N\geqslant 0}\sum_{n=c_N+1}^{c_{N+1}} \frac 1n\int_{c_{N+1}}^{b(c_N+1)}
f(u)du\geqslant \sum_{N\geqslant 0}\frac{c_{N+1}-c_N}{c_{N+1}}\int_{c_{N+1}}^{ c_{N+2}}
f(u)du$$
hence the series $\sum_{N\geqslant 0} \int_{c_{N+1}}^{ c_{N+2}}
f(u)du$ converges, which proves the claim. 

*So what would be helpful would be uniform convergence of $\sum_{n=1}^{\infty} f(nx)$ at least on a non-empty interval. Define 
$$
  F_N:=\left\{x\geqslant 0, \sum_{n=1}^{+\infty}f(nx)\leqslant N\right\}.
  $$


*

*For each fixed $N$, the set $F_N$ is closed since it can be written as the 
intersection of the sets $G_m$, where $G_m=\left\{x\geqslant 0, \sum_{n=1}^{m}f(nx)\leqslant N\right\}$ which is the inverse image of  the closed set $[0,N]$ by the continuous function $x\mapsto \sum_{n=1}^{m}f(nx)$. 

*By assumption, $[0,\infty)=\bigcup_{N\geqslant 1}F_N$.  


Consequently, by Baire's theorem, one of the $F_N$, say $F_{N_0}$ has a non-empty  interior and contains an interval $[x_0-2r_0,x_0+2r_0]$ (we also assume that $r_0\lt x_0$).

*For each $x\in [x_0-r_0,x_0+r_0]$, $\sum_{n=1}^{+\infty}f(nx)\leqslant N_0$ hence integrating on this interval and switching the series and the integral (without worrying, since everything is non-negative), we get 
$$\sum_{n=1}^{+\infty}\int_{x_0-r_0}^{x_0+r_0}f(nx)dx\leqslant 2N_0r_0.$$

*In each integral, do the substitution $u=nx$ and apply item 1. to $a=x_0-r_0$ and $b=x_0+r_0$.
