$f(0)=0$ and $f'(x)=f(x)^2$ At first sight, this exercise seems to be already seen many times in this website but I could not find a Analysis-1 level proof of the following :
Let $f: \mathbb{R} \to \mathbb{R}$ be a differentiable function such that $f(0)=0$ and $\forall x \in \mathbb{R}$, we have $f'(x)=[f(x)]^2$. Show that $f(x)=0, \forall x \in \mathbb{R}$.
My attempt is : Since $f'(x) \geq 0$ $\forall x$, we have that $\forall x \in \mathbb R^+ f(x) \ge 0$. By contradiction, suppose that $\exists a > 0$ such that $f(a)>0$. Since $f'=f^2\geq0$, we get that $f(x)>0$  for all $x \in (a, +\infty)$.
Let $g: (a,+\infty) \to \mathbb{R}$ be given by  $g(x)=\frac{1}{f(x)}$. As $g'(x)=-1$ we have $g(x)=-x+c$, $c \in \mathbb{R}$. So, $f(x)=\frac1{-x+c}, \forall x \in (a,+\infty)$. From $f(a)>0$ we get that $c>a$. But then $f$ isn't continuous at $x=c$, a contradiction.
I think I showed that the function is constantly equal to $0$ on $(0,+\infty)$, but how do I show it on $(-\infty,0)$ ? Should I just do the same proof with the g function on $(-\infty,a)$ with $a < 0$?
 A: Maybe I'm looking at this wrong, but it seems like we could easily do this with a separable ODE. Let $y = f(x)$. Then,
$\frac{dy}{dx} = y^2$
$\frac{dy}{y^2} = dx$
$\frac{-1}{y} = x + C$
$\frac{-1}{x + C} = y$
However, upon using the initial condition, we find a problem.
$\frac{-1}{C} = 0$
$-1 = 0$ which is obviously not true.
Therefore, the only possible solution to the ODE is the trivial solution. (i.e. f(x) = 0 is the only solution). And this is exactly what you want.
You mentioned you are in an Analysis class, so this may not suffice, but it seems like a decent way to go about it using methods from ODE.
A: Let $M_{\epsilon} = \sup_{x\in [-\epsilon, \epsilon]} |f(x)|$. We have $M_{\epsilon} \to 0$ as $\epsilon \to 0$. Now, for any $x\in [-\epsilon, \epsilon]$ we have
$$|f(x)| = |f(x) - f(0)| \le \sup_{t\in [-\epsilon, \epsilon]}|f'(t)|\cdot|x|\le \epsilon M_{\epsilon}^2$$
so
$$M_{\epsilon} \le \epsilon \cdot M_{\epsilon}^2$$
Now, if $M_{\epsilon} > 0$ we would get from the above $M_{\epsilon} > \frac{1}{\epsilon}$. Since $M_{\epsilon} \to 0$ we have $M_{\epsilon}= 0$ for $\epsilon$ small enough.
Conclusion: the set $\{x \ | \ f(x)=0\}$ is not only closed, but also open, so it must be the whole $\mathbb{R}$.
Note that we can generalize it to
$$|f'(x)| \le \phi(f(x))$$ and $f(0)=0$
where $\phi(t)\le C\cdot |t|$ on a neighborhood of $0$. We only use the intermediate value theorem.
A: Just to give a different approach to the proof that $f(0)=0$ and $f'(x)=f(x)^2$ imply $f(x)=0$ for all $x\gt0$, suppose that were not the case. Then there would exist $a$ and $b$ with $0\le a\lt b\lt a+1$ such that $f(a)=0$ and $0\lt f(b)\lt1$.  (I.e., if $f$ has nonzero values, it'll have one close to a zero, in which case continuity of $f$ means the value will be small. And as the OP observed, $f'(x)=f(x)^2$ and $f(0)=0$ imply $f(x)\ge0$ for all $x\gt0$, so any nonzero values are positive.)
Now the Fundamental Theorem of Calculus, on the one hand, and integration by parts (with $u=f(x)^2$ and $v=x-a$), on the other hand, give
$$f(b)=f(b)-f(a)=\int_a^bf'(x)\,dx=\int_a^bf(x)^2\,dx=(x-a)f(x)^2\Big|_a^b-2\int_a^b(x-a)f(x)f'(x)\,dx\\=(b-a)f(b)^2-2\int_a^b(x-a)f(x)^3\,dx$$
and thus
$$2\int_a^b(x-a)f(x)^3\,dx=f(b)((b-a)f(b)-1)\lt f(b)(1\cdot1-1)=0$$
But the non-negativity of $f(x)$ for $x\gt0$ implies the integral $\int_a^b(x-a)f(x)^3\,dx$ cannot be negative. This contradiction proves that $f(x)=0$ for all $x\gt0$ (and as Marco observes in comments below the OP, symmetry shows that $f(x)=0$ for all $x\lt0$ as well).
