All derivatives zero at a point $\implies$ constant function?

Suppose $f: \mathbb{R} \rightarrow \mathbb{R} $ is a continuous function, and there exists some $a \in \mathbb{R}$ where all derivatives of $f$ exist and are identically $0$, i.e. $f'(a) = 0, f''(a) = 0, \ldots$ Must $f$ be a constant function? or if not, are there examples of non-constant $f$ that satisfy these properties?

What if the hypothesis is changed so that the derivatives of $f$ are identically $0$ on an open interval, i.e. $f'(A) = 0, f''(A) = 0, \ldots$ for some open interval $A$. Are the answers still the same?


Yes, such functions do exist; they’re called flat functions. The simplest example that I know is the one given at the link:

$$f(x)=\begin{cases} e^{-1/x^2},&\text{if }x\ne 0\\ 0,&\text{if }x=0\;, \end{cases}$$

which is flat at $x=0$.

You can modify this example to get one that is flat on the interval $[0,1]$ but not constant on $\Bbb R$:

$$f(x)=\begin{cases} e^{-1/x^2},&\text{if }x<0\\ 0,&\text{if }0\le x\le 1\\ e^{-1/(x-1)^2},&\text{if }x>1\;. \end{cases}$$

In effect I’ve just cut the function at $x=0$ and moved the righthand half $1$ unit to the right, filling in the gap with the zero function.


Cauchy's function $f(x)=e^{-1/x^2}$ for $x\ne0$ and $f(0)=0$ has all derivatives at $0$ equal to $0$, but the function is not constant on any interval, thus answering your first question.

For your second question, of course if a function has first derivative equal to $0$ on an interval then the function is constant on that interval.


As others have pointed out, the canonical counter-example is the function $f(x)=e^{-1/x^2}$. But what is special about this function? The answer is that it is very badly behaved near $0$ in the complex plane, because $-1/x^2$ is arbitrarily large and positive along the imaginary axis close to $0$.


The function $f(x)$ defined as follows is non-constant and satisfies your second condition.

$f(x) = x$ if $x \le 0$

$f(x) = 0$ if $0 < x < 1$

$f(x) = x - 1$ if $1 \le x$