Find all continuous functions that satisfy: $\forall x\ge0, (f(x))^2=\int_0^x f(t)dt$ I've found 2 almost-duplicates of this question:


*

*Find all the continuous functions that satisfy $[f(t)]^2=F(t)-F(0)$

*If $\int_0^xf(t)dt=[f(x)]^2$ but $f(x)\neq 0$, what is $f(x)$?
However, the solutions assume that $f$ is differentiable. I want to find all continuous functions that satisfy it, differentiable or not.
So we already have:


*

*$f(x)=x/2$

*$f(x)=0$
Can we find other continuous functions? If not, how can we prove that no more exist?
 A: If $f$ is continuous, then $\int_0^xf(t)\,\mathrm dt$ is differentiable by the Fundamental Theorem of Calculus. Thus, the equal quantity $(f(x))^2$ is differentiable (and note that it's nonnegative). Then $\sqrt{(f(x))^2}=|f(x)|$ is differentiable wherever $f(x)\ne0$ by the Chain Rule. 
Since $f$ is continuous, it can't jump from positive to negative without crossing $0$ (by the intermediate value theorem). So $f$ is positive/negative on entire intervals. On an interval where $f$ is nonzero, $|f(x)|$ is $f(x)$ on the whole interval or $-f(x)$ on the whole interval. In the former case, $f(x)$ is differentiable on the interval. In the latter case, it's still differentiable on the interval by the constant multiple rule.
In conclusion, a continuous $f$ satisfying that equation must also be differentiable at any point where it's not zero. However, this alone doesn't rule out $f$ changing direction at points where $f=0$.
Indeed, where $f$ is nonzero and hence differentiable, we can differentiate both sides as in DeepSea's answer to the linked question to get $f(x)=x/2+C$ on that interval. However, any such function only attains the value $0$ at one point, $x=-2C$ so the function can't return to $0$ on two sides of being $x/2+C$. Also, we must have $f(0)=0$ because of the integral. Therefore, the only ways to stitch together functions of this form and locations where $f=0$ are: 


*

*$f(x)\equiv0$

*$f(x)\equiv x/2$

*$f(x)=\cases{0\text{ if }x<a\\(x-a)/2\text{ if }x\ge a}$ for some $a\ge0$

*$f(x)=\cases{(x-a)/2\text{ if }x<a\\0\text{ if }x\ge a}$ for some $a\le0$
