Show $\int_{0}^{1}(\int_{0}^{x}g(t)dt)^2 dx\leq\frac{1}{2}\int_0^1(1-x^2)(g(x))^2 dx$ for any $g(x)$ continuous

Prove (or disprove) that $$\int_{0}^{1}\left(\int_0^x g(t)\ dt\right)^2dx\leq\frac{1}{2}\int_0^1 (1-x^2)(g(x))^2 dx$$ for any $g(x)$ continuous on $[0,1]$.

I have verified the cases of $g(x)$ being monomials like $x^k (k\in \mathbb{N})$ and found the equality holds iff $k=0$, namely, $g(x)\equiv 1$.


Solution 1:

\begin{align*} \int_{0}^{1}\left(\int_{0}^{x}g(t)dt\right)^{2}dx&=\int_{0}^{1}\left(\int_{0}^{1}\chi_{0\leq t\leq x}g(t)dt\right)^{2}dx\\ &\leq\int_{0}^{1}\left(\left(\int_{0}^{1}\chi_{0\leq t\leq x}^{2}dt\right)^{1/2}\left(\int_{0}^{1}(\chi_{0\leq t\leq x}g(t))^{2}dt\right)^{1/2}\right)^{2}dx\\ &=\int_{0}^{1}\left(\int_{0}^{x}dt\right)\left(\int_{0}^{x}(g(t))^{2}dt\right)dx\\ &=\int_{0}^{1}x\left(\int_{0}^{x}(g(t))^{2}dt\right)dx\\ &=\int_{0}^{1}\int_{0}^{x}x(g(t))^{2}dtdx\\ &=\int_{0}^{1}\int_{t}^{1}x(g(t))^{2}dxdt\\ &=\int_{0}^{1}(g(t))^{2}\int_{t}^{1}xdxdt\\ &=\int_{0}^{1}(g(t))^{2}\dfrac{1}{2}(1-t^{2})dt\\ &=\dfrac{1}{2}\int_{0}^{1}(1-x^{2})(g(x))^{2}dx. \end{align*}