Does $f(0)=0$ and $\left|f^\prime(x)\right|\leq\left|f(x)\right|$ imply $f(x)=0$?

Let $F(x)=|f(x)|$. Then if $x>0$ $$ F(x)=\Bigl|\int_0^xf'(t)\,dt\Bigr|\le\int_0^x|f'(t)|\,dt\le\int_0^x|f(t)|\,dt=\int_0^xF(t)\,dt. $$ From here we get $$ \Bigl(e^{-x}\int_0^xF(t)\,dt\Bigr)'=e^{-x}\Bigl(F(x)-\int_0^xF(t)\,dt\Bigr)\le0. $$ Thus, $e^{-x}\int_0^xF(t)\,dt$ is decreasing. Since its value at $x=0$ is $0$ and $e^{-x}>0$, we see that $\int_0^xF(t)\,dt\le0$ for all $x>0$. Since $F\ge0$, this implies that $F(x)=0$ for all $x>0$.

A similar reasoning applies if $x<0$.


Suppose $x$ is some real number with $f(x)=0$, and let $y\in [x-1/2,x+1/2]$ be such that $|f(y)|$ is maximized. Then the mean value theorem implies there is some $z$ between $x$ and $y$ such that $$ 2\cdot |f(y)|\leq \frac{|f(y)|}{|y-x|}=\left|\frac{f(y)-f(x)}{y-x}\right|=|f'(z)|\leq |f(z)|\leq |f(y)|, $$ which implies $f(y)=0$. We have shown that $f(x)$ implies $f$ is $0$ on $[x-1/2,x+1/2]$, so $f$ must be identically $0$.