TITLE: If the derivative of a function is square of it then it is constant
QUESTION [7 upvotes]: Let $f:\mathbb{R}\to\mathbb{R}$ is differentiable and $f(0)=0$. Also $\forall x\in \mathbb{R}$ we have $f'(x)=f^2(x)$. Prove that $f(x)=0$, for every $x$.
I tried to use MVT for both derivative and integral. But I got nowhere.
I just found out that

$f$ is increasing.
for positive values $f$ is non negative.
$\forall x>0$, there exists some $c\in (0,x)$ s.t. $f(x)=xf^2(c).$

Intuitively, it seems one can start by a small interval around zero and show that $f=0$ and so on.
Any comment!

REPLY [7 votes]: On the set where $f(x) \neq 0$ the derivative of $-1/f$ is $1 $ so we get $f(x) (x+c)=-1$ for some constant $c$. It follows that the continuous function $f(x) (x+c)$ takes only two values $0$ and$-1$. Hence it is a constant. But $f(0)=0$ so $f$ must vanish identically. [We get $f(x)=0$ for $x \neq -c$ but $f(-c)$ is also $0$ by continuity].
Some additional details: The set where $f \neq 0$ is an open set, so it is a countable disjoint union of open intervals. If $(a,b)$ is one of these intervals then there exits $c$ such that $f(x)(x+c)=-1$ in $(a,b)$ and it is $0$ at the end points. This contradicts continuity of $f$. Conclusion: there is no point $x$ with $f(x) \neq 0$.