TITLE: $f'(x) = [f(x)]^{2}$. Prove $f(x) = 0 $
QUESTION [7 upvotes]: Let $f:\mathbb{R} \rightarrow \mathbb{R}$ be a differentiable function such that $f(0) = 0$ and $f'(x) = [f(x)]^{2}$, $\forall x \in \mathbb{R}$. Show that $f(x) = 0$,  $\forall x \in \mathbb{R} $.
I first (unsuccessfully) tried using the Mean Value Theorem, but this is in the Integrals chapter so the solution probably involves them. Can't really see where integrals come in here though.
What I've got so far: 
(i) Since $f$ is differentiable, thus it is continuous and, hence,  integrable. Therefore $f^2$ is also integrable and as $f'=f^2$, $f'$ is too. 
(ii) $f' \geq 0$, $\forall x \in \mathbb{R}$

REPLY [2 votes]: An elementary direct proof similar to but different from Paramand Singh's.
For contradiction, assume there is $a$ with $f(a) \neq 0$. By continuity of $f$, there is $\epsilon > 0$ such that $f(x) \neq 0$ for all $x \in (a-\epsilon, a +\epsilon)$. Set
$$b:= \begin{cases} \inf \lbrace x \le a: f(x) \neq 0 \rbrace \text{ if } a >0 \\ \sup\lbrace x \ge a: f(x) \neq 0 \rbrace \text{ if } a <0
\end{cases}.$$
Because $f(0) = 0$, $b \in \mathbb R$ in both cases; by continuity of $f$, $f(b) = 0$ (and hence $a \neq b$); by definition, $f(x) \neq 0$ for all $x \in (b, a)$ (resp. $(a,b)$).
Then on $(b, a)$ (resp. $(a,b)$), we can set $g(x) := \dfrac{1}{f(x)}$, and have $g'(x) = \dfrac{-f'(x)}{(f(x))^2} = -1$ and hence $g(x) = -x+C$ or
$$f(x) = \dfrac{1}{C-x}$$
for all $x \in (b, a)$ (resp. $(a,b)$), where $C$ is some constant.
Thus $f(b)= 0 \neq \frac{1}{C-b} = \lim_{x \to b^+} f(x)$ (resp. $\lim_{x \to b^-} f(x)$), contradicting continuity of $f$.

Note the basic idea is that on any open interval where $f$ has no zero, it has to be of the form $\dfrac{1}{C-x}$ for some $C$. Then one can conclude, using continuity of $f$ one way or another, that the set of $x$ where it is of that form with one specific $C$ must be both closed and open, hence the entire number line, which by the way gives a contradiction (at $x=C$) even without assuming $f(0)=0$, just from assuming $f$ is differentiable everywhere.