If $f(0) = 0$ and $|f'(x)|\leq |f(x)|$ for all $x\in\mathbb{R}$ then $f\equiv 0$ Let $f:\mathbb{R}\rightarrow\mathbb{R}$ be a continuous and differentiable function in all $\mathbb{R}$. If $f(0)=0$ and $|f'(x)|\leq |f(x)|$ for all  $x\in\mathbb{R}$, then $f\equiv 0$.
I've been trying to prove this using the Mean Value Theorem, but I can't get to the result. Can someone help?
 A: Consider $S := \{ x \in \mathbb{R} : f(x) = 0 \}$.  This set is closed by the continuity of $f$.  We now claim $S$ is also open.  To show this, suppose $x_0 \in S$, and let $A := \sup \{ |f(x)| : x \in (x_0 - \frac{1}{2}, x_0 + \frac{1}{2}) \}$.  Then, for $x \in (x_0 - \frac{1}{2}, x_0 + \frac{1}{2})$, we have $f(x) = \int_{x_0}^x f'(t)\,dt$, and $|f'(t)| \le |f(t)| \le A$ for $t$ between $x$ and $x_0$, so $|f(x)| \le |x - x_0| A \le \frac{1}{2} A$.  Thus, by the definition of $A$ as a supremum, $0 \le A \le \frac{1}{2} A$, which implies $A = 0$.  This implies that $f(x) \equiv 0$ for $x \in (x_0 - \frac{1}{2}, x_0 + \frac{1}{2})$, establishing that $S$ is a neighborhood of $x_0$.
Now, we have shown that $S$ is a clopen subset of $\mathbb{R}$, and we are given that $0 \in S$ so in particular, $S$ is nonempty.  By the connectedness of $\mathbb{R}$, this implies $S$ is all of $\mathbb{R}$, which is equivalent to the desired conclusion.
A: Let $\vert x \vert \leq \frac{1}{2}$ and let $x_0\in \mathbb{R}$ such that $f(x_0)=0$.
$$ \vert f(x_0+x) \vert = \left\vert f(x_0) + \int_0^x f'(x_0+t) dt \right\vert = \left\vert \int_0^x f'(x_0+t) dt \right\vert $$
using the triangular inequality for integrals yields
$$ \leq \left\vert \int_0^x \vert f'(x_0+t) \vert dt \right\vert
\leq \left\vert \int_0^x \vert f(x_0+t) \vert dt \right\vert 
\leq \left\vert \int_0^x \max_{\vert s\vert \leq \frac{1}{2}}\vert f(x_0+s) \vert dt \right\vert
\leq \vert x \vert \cdot \max_{\vert s\vert \leq \frac{1}{2}}\vert f(x_0+s) \vert.$$
Now we take the maximum over all $\vert x \vert \leq \frac{1}{2}$ and obtain
$$ \max_{\vert s\vert \leq \frac{1}{2}}\vert f(x_0+ s) \vert \leq \frac{1}{2} \max_{\vert s\vert \leq \frac{1}{2}}\vert f(x_0+s) \vert. $$
Thus, $\max_{\vert s\vert \leq \frac{1}{2}}\vert f(x_0+ s) \vert=0$ and hence
$$ \forall \vert t \vert \leq \frac{1}{2}: \ f(x_0+t)= 0.$$
By induction we prove that $f(t)=0$ for all $t\in \left[ -\frac{n}{2}, \frac{n}{2} \right]$ for all $n\in \mathbb{N}$ and therefore $f$ is identicially zero.
Added: If one does not want to use integrals, one can use the mean value theorem in the following way: For $\vert x \vert \leq \frac{1}{2}$ there exists $\vert \xi(x) \vert \leq \vert x \vert$ such that
$$ \vert f(x) \vert = \vert f(x) - f(0) \vert = \vert f'(\xi(x)) \vert \cdot \vert x \vert
\leq \vert f(\xi(x)) \vert \cdot \vert x \vert 
\leq \max_{\vert s \vert \leq \frac{1}{2}} \vert f(s) \vert \cdot \vert x\vert .$$
Taking again the maximum over all $\vert x \vert \leq \frac{1}{2}$ one arrives at $\max_{\vert s \vert \leq \frac{1}{2}} \vert f(s) \vert \leq \frac{1}{2} \max_{\vert s \vert \leq \frac{1}{2}} \vert f(s) \vert$ and proceeds as above.
A: Intuitively, the solution to $|f'| \leq |f|$ with $f(0) = c$ can not grow out of the region bounded by the solutions to $f' = +f$ and $f' = -f$ with the same initial condition $f(0) = c$. The boundary solutions are $f_\pm(x) = c e^{\pm x} = 0$ with $c = 0$ we have $f_\pm(x) \equiv 0$.
It's so obvious intuitively, I think, but was not at all as easy to prove as I thought, but finally I came up with a proof. But first a lemma:
Lemma
Let $h : \mathbb [0, \infty) \to \mathbb R$ be differentiable and satisfy 


*

*$h(x_0) > 0$,

*$h'(x) > 0$ when $x > x_0$ and $h(x) > 0$.


Then $h(x) > 0$ for all $x \geq x_0$.
Proof of lemma
Assume that $h(a) \leq 0$ for some $a > x_0$. Since $h$ is continuous, by the intermediate value theorem, $h$ takes the value $0$ in at least one point between $x_0$ and $a$. Let $x_1 = \inf \{ t \in (x_0, a) \mid h(t) = 0 \}$. Since $h$ is continuous and $h(x_0) > 0$ we have $x_1 > x_0$ and $h(x) > 0$ when $x_0 < x < x_1$. Then $h(x_1) - h(x_0) < 0$ and by the mean value theorem there exists some $\xi \in (x_0, x_1)$ such that $h'(\xi) = (h(x_1) - h(x_0))/(x_1 - x_0) < 0$. But this contradicts that $h'(x) > 0$ when $x > x_0$ and $h(x) > 0$. Thus $h(x) > 0$ for $x \geq x_0$.
Proof of statement in question
Take $\lambda>0$.
Let $g(x) = \lambda e^x$. Then $g-f$ satisfies the conditions of the lemma with $x_0=0$. Thus, for all $x > 0$ we have $(g-f)(x) > 0$, i.e. $f(x) < \lambda e^ x$.
In the same way, taking $g(x) = -\lambda e^x$ we have $f-g$ satisfying the conditions of the lemma so $f(x) > -\lambda e^x$ for $x > 0$.
Thus, for $x > 0$ we have $-\lambda e^x < f(x) < \lambda e^x$. Since $\lambda>0$ was arbitrary we must have $f(x) \equiv 0$ for $x > 0$.
Reversing the function, i.e. letting $f(x) \to f(-x)$ in the above, we also get that $f(x) \equiv 0$ for $x < 0$.
