If the derivative of a function is square of it then it is constant

Suppose for some $x_0$ you have $f(x_0)\neq0$. Then you can solve the differential equation $$\frac{f'(x)}{f^2(x)}=1$$ with the initial condition $f(x_0)$, which gives $$\frac{-1}{f(x)}+\frac{1}{f(x_0)}=x-x_0\iff f(x)=\frac{1}{c-x}$$ where $c$ is a constant, and this holds for every $x$ that is in the same component of $\mathbb R\backslash\{c\}$ with $x_0$, say $I=(-\infty,c)$. This goes to $\infty$ as $x$ approaches $c$, hence it cannot be the restriction of a function that is differentiable over $\mathbb R$ to $I$.


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$.