if we have $(f(x))^2 = 2 \int_0^xf, \ \forall x>0,$ then $f(x) =x \ \forall x\geq0$. Let $f: [0, \infty) \to \Bbb R$ be continuous and $f(x) \neq 0 \forall x>0$. If we have $$(f(x))^2 = 2 \int_0^xf, \ \forall x>0,$$
then $f(x) =x \ \forall x\geq0$.
We have $(f(x))^2 = 2 \int_0^xf, \ \forall x>0,$. Differentiating we have $2f(x)f'(x) = 2f(x) \implies f'(x) = 1 $. Thus  $f(x) =x \ \forall x\geq0$. Is the proof correct?

Let's see what happens
if we assume
$(f(x))^a = b \int_0^xf(t)dt, \ \forall x>0
$.
(Note:
I write
$f^a(x)$
for
$(f(x))^a$.)
Differentiating
as you did,
$a f'(x)f^{a-1}(x)
=b f(x)
$
or
$ f'(x)f^{a-2}(x)
=b/a
$.
If $a=1$,
then
$f'(x)/f(x)
=b
$,
or
$\ln f(x)
=bx+c
$
or
$f(x)
=e^{bx+c}
$.
Putting this in 
the original equation,
$e^{bx+c}
=b\int_0^x e^{bt+c}dt
=e^c(e^{bx}-1)
$
which is not true
for any real $b$.
If $a \ne 1$,
since
$(f^{a-1}(x))'
=(a-1)f^{a-2}(x) dx
$,
$(f^{a-1}(x))'
=(a-1)b/a
$,
so
$f^{a-1}(x)
=(a-1)bx/a+c
$
or
$f(x)
=((a-1)bx/a+c)^{1/(a-1)}
$.
Since $f(0) = 0$,
$c = 0$,
so
$f(x)
=((a-1)bx/a)^{1/(a-1)}
$.
If $a=b=2$,
as in the original problem,
$f(x)
=x
$.
