Find a function $g$ continuous in $[0,\infty]$ and positive in $(0,\infty)$ satisfying $g(0)=1$ and $$ \tag{1} \frac{1}{2}\int_{0}^{x} g^2(t)dt=\frac{1}{x}f^2(x), $$ where $f(x)=\int_0^x g(t)dt$.
My try:clearly $f'(x)=g(x)$
differentiating original condition we get
$$4f(x)g(x)=xg^2(x)+\int_{0}^{x}g^2(t)dt$$
using (1)
$$4f(x)g(x)=xg^2(x)+\frac{2}{x}f^2(x)$$
now i am stuck
Dividing the relation by $x$ and writing $f$ explicitly, we have that $$ \frac{1}{2} \cdot \frac{1}{x} \int_0^x g^2 = \left(\frac{1}{x}\int_0^x g\right)^2, \qquad \forall x > 0. $$ Passing to the limit as $x\to 0^+$ and taking into account that $g(0) = 1$ we thus obtain that $1/2 = 1$, a contradiction.
Hence, there is no such $g$.