Almost periodic function with mean value zero 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.
 A: This is actually false.
$AP$ is a Banach space with the uniform norm, being precisely the uniformly closed span of a set of functions. It turns out that $AP_0$, the space of functions in $AP$ with mean zero, is a closed subspace. (It's not hard to show this directly (details below). Or if you want to be cool, you get into the not-quite-trivial theory: In fact $f\in AP$ has mean zero  if and only if $f$ is in the closed span of the functions $e_a(t)=e^{iat}$ for $a\ne0$.)
Say $Tf(x)=\int_0^x f(t)\,dt$.
If $Tf$ were bounded for every $f\in AP_0$ the Closed Graph  Theorem would show that $||Tf||_\infty\le c||f||_\infty$ for $f\in AP_0$, which  is clearly not so.
Details: Define $Af(x)=\frac1x\int_0^x f(t)\,dt$. Say $f_n\in AP_0$ and $f_n\to0$ uniformly. Then $Af_n\in C_0([0,\infty))$ and $Af_n\to Af$ uniformly, so $Af\in C_0$, hence $Mf=0$.
Note Usually the mean value is defined as $\lim\frac1{2T}\int_{-T}^T$. Wasn't  clear to me immediately, but that's  actually equal to the mean value defined above. Proof: The two are the same if $f(t)=e^{iat}$.
A: 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}$$
