Integral of $L^2(\mathbb R^+)$ function is $o(\sqrt x)$ I stumbled upon an exercise which goes as follows :

Let $f \in L^2(\mathbb R^+)$, show that $\int_0^x f(t)\text{d}t = o\left(\sqrt x\right)$.


*

*Cauchy-Schwarz inequality gives the fact that $\int_0^x f = O\left(\sqrt x\right)$

*For decreasing functions, the results holds since $xf(x)^2 \leq \int_x^{2x} f^2 = o(1)$.

*Simple limit examples such as $f(t) = \dfrac 1 {\sqrt t\ln(t)}$ or $f(t) = \displaystyle\sum_{k} \dfrac{1_{[k,k+1]}}{\sqrt k}$ advocate for the result.

However I cannot produce a proof of that result nor find any counterexample, I don't even know what to believe. Given the source of the problem, a proof, if there is, should be elementary.
Happy Hollidays

To elaborate on my comment. Fix an arbitrary $f\in L^2$ and let $g\in L^2 \cap L^p$ for some $1<p<2$. A simple triangle inequality followed by Hölder's inequality gives
$$
\lvert \int_0^x f(t)dt \rvert \leq \lvert \lvert f-g\rvert \rvert_{L^2}\sqrt{x} + \lvert \lvert g \rvert \rvert_{L^p} x^{1-1/p}.
$$
This implies that
$$
\limsup_{x \to \infty} \frac{1}{\sqrt{x}} \lvert \int_0^x f(t) dt \rvert \leq \lvert \lvert f-g\rvert \rvert_{L^2} \qquad \forall g \in L^2 \cap L^p.
$$
Using the fact that $ L^2 \cap L^p$ is dense in $L^2$, we can take the infimum of all such $g$'s, thus proving the claim.
