I want to prove the following (I believe it is true but I am not sure)
If $f\in \mathrm{AP}(\mathbb{R})$, where the space of almost periodic functions $\mathrm{AP}(\mathbb{R})$ is defined in the sense of Bohr https://en.wikipedia.org/wiki/Almost_periodic_function with the mean value $$ M(f) = \lim_{T\longrightarrow \infty} \frac{1}{T}\int_{0}^T f(x)\;dx = 0 $$ then its anti-derivative \begin{equation*} F(x) = \int_0^x f(t)\;dt \end{equation*} is bounded.
The analog of this in the case $f$ is periodic is clear, but I don't know how to do with this case. One idea is using approximation by trigonometric polynomials but there is still some difficulties.
Hint
$$f(x)=\sum_{n} \frac{1}{n^2} e^{i\frac{x}{n^2}}$$ is almost periodic as the uniform limit of trig polynomials.
Assume now by contradiction that $F(x)=\int_0^x f(t) dt$ is almost periodic. Then the Fourier Bohr coefficient at $e^{in^2x}$ is given by $$b_{\frac{1}{n^2}}=\langle F(x), e^{-i\frac{x}{n^2}} \rangle =\lim_{T\longrightarrow \infty} \frac{1}{T}\int_{0}^T F(x) e^{-i\frac{ x}{n^2}}\;dx$$
Use integration by parts to conclude that $b_{\frac{1}{n^2}}=\frac{1}{i}$. But this contradicts the Bessel inequality $$\sum_{n} |b_{\frac{1}{n^2}}|^2 \leq \langle F(x), F(x) \rangle $$
P.S. If you need any details for any step let me know.
Added: $$\frac{1}{T}\int_{0}^T F(x) e^{-i\frac{ x}{n^2}}=\frac{1}{T} \left( F(x) \frac{n^2}{-i}e^{-i\frac{ x}{n^2}}|_0^T-\frac{n^2}{-i}\int_0^T f(x) e^{-i\frac{ x}{n^2}} \right)$$
Now, since we assumed that $F(x)$ is bounded, we have $$\lim_{T \to \infty} \frac{1}{T} \left( F(x) \frac{n^2}{-i}e^{-i\frac{ x}{n^2}}|_0^T \right)=0$$
Therefore $$\langle F(x), e^{-i\frac{x}{n^2}} \rangle= \lim_T \frac{n^2}{i}\int_0^T f(x) e^{-i\frac{ x}{n^2}} =\frac{1}{i}$$