Can someone please tell me if my approach is right or has errors?
First, we need to use Gronwall - Bellman's inequality to show that all non-negative, continuous functions $f(t)$ that satisfy $$f(t)\le\int_0^t f(s)ds,\quad t\ge0$$ are equal to 0. Since we want to show that $[f(t)]^2=\int_0^t f(s)ds$, we know that $\int_0^t f(s)ds\ge 0$, while $f$ is continuous. Hence, the functions that satisfy the equality above are all $f(t)=0,\quad t\ge0\quad$(since we don't know if the functions are differentiable or not).
There is no relation between your inequality and your original equality.
If $f $ is continuous and satisfies the equality, then $f^2$ is differentiable. If $f (x_0)>0$ for some $x_0 $, then $f (x)=[f (x)^2]^{1/2} $ is differentiable on that interval. Similarly where $f $ is negative.
So, on any interval where $f $ is nonzero we can differentiate to get $$2f (x)f'(x)=f (x). $$ Thus on such interval $f'(x)=1/2$. This gives $f (x)=x/2+c $. Plugging this into the equation gives $$cx+c^2=cx, $$ so $c=0$.
Then a continuous $f $ that satisfies the equation is $f (x)=x/2$ for every $x $ such that $f (x)\ne0$. By continuity, $f (x)=x/2$. This is the only solution other than the zero function.
As mentioned by A.G. below, if the domain is the whole real line, then f is zero for negative x.