Consider the Lebesgue measure on Borel sets of $(0,\infty)$. Prove that for every $f\in L^2(0,\infty)$,
$|\int_{0}^{x} f(s) ds|^2\leq 2\sqrt{x}\int_{0}^{x} \sqrt{s} |f(s)|^2 ds$.
My trial:
Naturally, we can think of Holder's inequality
$|\int_{0}^{x}f(s)ds|^2\leq \left(\int_{0}^{\infty}|\chi_{[0,\infty)}||f(s)|ds\right)^2 \leq \|\chi_{[0,x)} \|_2^2 \|f\|^2_2=x\int_{0}^{\infty}|f(s)|^2 ds$
And it is totally different from the desired result. I have no idea how to put $|\chi_{[0,x)}|$ into the integral of $f$ anyway.
What about the Cauchy-Schwarz Inequality? Note that $$\left|\int_0^x\,f(s)\,\text{d}s\right|^2\leq\left|\int_0^x\,\frac{1}{\sqrt[4]{s}}\,\Big(\sqrt[4]{s}\,\big|f(s)\big|\Big)\,\text{d}s\right|^2\leq \left(\int_0^x\,\frac{1}{\sqrt{s}}\,\text{d}s\right) \,\left(\int_0^x\,\sqrt{s}\,\big|f(s)\big|^2\,\text{d}s\right)\,.$$ The equality holds iff there exists a constant $c\in\mathbb{C}$ such that $f(s)=\dfrac{c}{\sqrt{s}}$ for almost every $s\in[0,x]$.