If $\{f(x)\}^2 = 2\int_0^xf(t)dt $ then $f(x) = x$ for all $x \geq 0$. A function $f$ is continuous for all $x \geq 0$ and $f(x) \neq 0$ for all $x >0$. 
If $\{f(x)\}^2 = 2\int_0^xf(t)dt $ then $f(x) = x$ for all $x \geq 0$.
But I am stuck with the sum. 
 A: By the Fundamental Theorem of Calculus, the function
$$x\mapsto\int_0^xf(t)dt$$
is differentiable since $f$ is continuous. Hence, $(f(x))^2=2\int_0^xf(t)dt$ is differentiable. Since, $f(x)\neq 0$ for $x>0$ and $\sqrt{}$ is differentiable on $(0,\infty)$, the composition
$$\sqrt{(f(x))^2}=|f(x)|=f(x)\tag{1}$$
is differentiable for $x>0$. Thus,
$$\frac{d}{dx}(f(x))^2=2f(x)f'(x),\quad\forall x>0.$$
But also,
$$\frac{d}{dx}(f(x))^2=\frac{d}{dx}2\int_0^xf(t)dt=2f(x),$$
by the fundamental theorem of calculus again. Hence,
$$2f(x)f'(x)=2f(x),\quad\forall x>0.$$
Since $f(x)\neq 0$ there, this implies
$$f'(x)=1,\quad \forall x>0,$$
and hence
$$f(x)=x+C,\quad\forall x>0$$
for some constant $C$ (you can prove this by the Mean Value Theorem). By continuity of $f$, this holds for all $x\ge 0$. Evaluating the given constraint at $0$ we get
$$C^2=2\int_0^0f(t)dt=0\implies C=0.$$
Thus, $f(x)=x$ for all $x\ge 0$.
Added: In $(1)$ I used that $f(x)>0$ for $x>0$. To prove this, note that since $f(x)\neq 0$ for $x>0$ it suffices to show that $f(x)>0$ for one $x>0$ (by the Intermediate Value Theorem). But if $f(x)< 0$ for all $x>0$ then $0<(f(x))^2=2\int_0^xf(t)dt\le 0$, a contradiction.
Additional remark:
Note how nice is this exercise to practice applications of basic analysis theorems. It uses five of the most important tools one learns in first year undergraduate analysis:


*

*Fundamental Theorem of Calculus

*Intermediate Value Theorem

*Mean Value Theorem

*Composition of differentiable functions is differentiable

*Continuous functions are determined by their values on a dense set

A: Differentiate both sides w.r.t. $x$  
Simplifying yields $2(f'(x)-1)f(x)=0$
i.e. $f'(x)=1$ or $f(x)=0$ (rej.)  
Then integrate it back w.r.t. $x$ to get $f(x)=x+C$, use $f(0)=0$ and get $f(x)=x$.
