I am trying to prove an inequality that is
$\left\| \frac{1}{x}\int_{0}^{x} f(s) ds \right\|_2 \leq 2\|f\|_2=2\left( \int_{0}^{\infty} |f(s)|^2ds \right)^\frac{1}{2}$
where $f\in L^2([0,\infty))$ and $\|\cdot\|_2$ is $L^2([0,\infty))$ norm.
I have used several ways but those ways fail to prove the inequality. Especially, if we use Holder's inequality for functions $\chi_{[0,x]}$ and $f$, we get infinity... I have no idea.... this inequality might be helpful but I am not sure.
$|\int_{0}^{x} f(s) ds|^2\leq 2\sqrt{x}\int_{0}^{x} \sqrt{s} |f(s)|^2 ds$
thanks in advance!
We can use the other inequality to get $$\left\lVert x \mapsto \frac{1}{x} \int_0^x f(s) \, \mathrm{d} s \right \rVert_2^2 \leq \int \limits_0^\infty \frac{2 \sqrt{x}}{x^2} \int \limits_0^x \sqrt{s} |f(s)|^2 \, \mathrm{d} s \, \mathrm{d} x = 2 \int \limits_0^\infty \frac{1}{x^{3/2}} \int \limits_0^x \sqrt{s} |f(s)|^2 \, \mathrm{d} s \, \mathrm{d} x \, .$$ Changing the order of integration (Tonelli's theorem) we find $$ \left\lVert x \mapsto \frac{1}{x} \int_0^x f(s) \, \mathrm{d} s \right \rVert_2^2 \leq 2 \int \limits_0^\infty \sqrt{s} |f(s)|^2 \int \limits_s^\infty \frac{1}{x^{3/2}} \, \mathrm{d} x \, \mathrm{d} s = 4 \int \limits_0^\infty |f(s)|^2 \, \mathrm{d} s = 4 \lVert f \rVert_2^2$$ as desired.