How to find $f(x)$ from given condition $f^2(x)=1+\int_{0}^{x}f(t)dt$ 
Let $f:\mathbb{R} \rightarrow \mathbb{R }$ satisfy the following
$$(f(x))^2 = 1+\int_0^x f(t) \, \mathrm d t$$
How can we find $f(x)$?

I don't know how to attack such a problem. Please give me some hints on how to move on.
 A: take derivative on both side of  $2f(x)f'(x)=f(x)$ implies 
$f'(x)=\frac{1}{2}$ so what is $f(x)$
we will get $f(x)=\frac{x}{2}+c$
and $f^2(x)$=$1+\int_{0}^{x}f(t)dt$ implies $f(0)=\pm 1$ so you will get the value of $c$
A: Let us explore the possibly non continuous solutions of the equation. We suppose that $f$ is a solution defined in an interval $I$ containing $0$, such that $f \in L^1([a, b])$ for every compact interval $[a,b]\subset I$.
Let us define $\epsilon(x) = \text{sgn}(f(x))$, so that $f(x) = \epsilon(x)g(x)$ and $g(x)$ is non negative. Substituting in the original equation, we get
$$g^2(x) = 1 + \int_0^x \epsilon(t) g(t) d t$$
As $g$ is non negative, we may write
$$g(x) = \sqrt{1 + \int_0^x \epsilon(t) g(t) d t}$$
The integral in this expression is an absolutely continuous function of $x$ and the above expression shows that $g$ is a continuous function of $x$.
We can go a little further because we know that for almost all $x$, the integral is differentiable at $x$ and
$$\left(\int_0^x \epsilon(t) g(t) d t\right)^\prime = \epsilon(x) g(x)$$ We deduce that for almost every point $x$ such that $g(x)\not = 0$, one has
$$g^\prime(x) = \frac{\epsilon(x) g(x)}{2\sqrt{1 + \int_0^x \epsilon(t) g(t) d t}} = \frac{1}{2}\epsilon(x)$$
We know that $g(0)=1$, so that $g(x)>0$ in a neighbourhood of $0$. In this neighbourhood, the above equation implies that
$$g(x) = 1 + \frac{1}{2} E(x)\quad \text{where}\quad \boxed{E(x)=\int_0^x \epsilon(t) d t}$$
We deduce that
$$\boxed{f(x) = \epsilon(x)\left(1 + \frac{1}{2} E(x)\right)}$$
From this formula, it is easy to check the original equation when $\epsilon(x)\not = 0$ because
$$\int_0^x f(t) d t = \int_0^x (\epsilon(t) + \frac{1}{2}\epsilon(t) E(t)) d t = E(x) + \frac{1}{4}E^2(x) = f^2(x) - 1$$
Obviously, any function $f$ defined by the above formula, where $\epsilon(x)$ is a measurable function with value in $\{-1, 1\}$ is solution of the initial problem (even if $\epsilon(x)$ is not the sign of $f$).
There remains the question to determine if all the solutions have this form. This is probably not the case because one can imagine intervals where $\epsilon(x) = 0$ and $E(x) + \frac{1}{4} E^2(x) = -1$ and the equation is satisfied. On such intervals, one would have $f(x) = 0$ and $E(x) = -2$.
