If $f$ is infinitely differentiable and equal to 0 on $(-\infty, 0]$, must $f$ be 0 everywhere else

real-analysissmooth-functions

While working on question A5 from the 2018 Putnam Exam, I ran into the following problem: if $f: \mathbb{R} \to \mathbb{R}$ is infinitely differentiable (i.e. smooth) and $f(x) = 0$ when $x \in (-\infty, 0]$, must $f$ be $0$ everywhere else?

What I've figured so far: Clearly $f^{(n)}(x)$ is $0$ on $(-\infty, 0)$. If $f$ is at some point non-zero, we could (by the Mean Value Theorem) find a $c$ so that $f'(c)$ is non-zero. This would give us an infinite number of $f^{(n)}(c_n)$'s that are non-zero. My thought is that this would eventually force $f^{(n)}$ to be non-differentiable, a contradiction. My intuition here is $f$ is going to look like a piecewise function, which generally aren't differentiable at the "boundary" between the pieces. An example I have in mind is that
$$ f(x) = \begin{cases}0 & x \leq 0;\\ x^2 & x > 0 \end{cases}$$
is differentiable, but not twice differentiable at $0$; both sides ''agree'' that the first derivative should be $0$, but the difference quotient doesn't match when taking a left- vs. right-sided limit for the second derivative.

Is this even a true statement? Are there counterexamples to it? If not, what would be the right way to prove it?

Best Answer

A well known example of an infinitely differentiable function vanishing on negative real line is $f(x)=e^{-1/x}$ for $x>0$ and $0$ for $x \leq 0$.

Related Question