# Can a smooth function have an uncountable number of roots?

Out of idle curiosity:

Does there exist a smooth but non-constant univariate function $f(x)$ over $\mathbb{R}$ such that $f(x)=0$ has an uncountable number of solutions?

My intuition is that the answer is 'no', and that a solid proof of this fact will be simple, but I'm at a loss to think of one. This question about holomorphic functions seems pertinent, but it starts with the assumption that no limit points exist, and I'm not sure where this assumption comes from or whether it applies here.

Edit: Some answers also concern "Can such a function exist that isn't zero on any interval of $\mathbb{R}$?"

• Do you mean discrete roots or something? Otherwise just take $f$ to be identically $0$...or $0$ for $x≤0$ and $\exp(-\frac 1{x^2})$ for $x>0$. – lulu Aug 30 '16 at 15:55
• @lulu: I think that's why the "non-constant" provision. – Eli Rose -- REINSTATE MONICA Aug 30 '16 at 15:56
• The standard non-analytic smooth function on $\mathbb R$ is zero for $x\leq 0$ and non-zero for $x>0$:$$f(x)=\begin{cases}e^{-1/x^2}&x>0\\0&x\leq 0\end{cases}$$ – Thomas Andrews Aug 30 '16 at 15:56
• @EliRose My second example is non-constant. – lulu Aug 30 '16 at 15:56
• If you want it to be non-constant on any interval, that is likely to be impossible. – Thomas Andrews Aug 30 '16 at 15:58

The standard non-analytic smooth function on $\mathbb R$ is zero for $x\leq 0$ and non-zero for $x>0$:$$f(x)=\begin{cases}e^{-1/x^2}&x>0\\0&x\leq 0\end{cases}$$
Every closed subset of $\mathbb R$ is the precise zero set of a $C^\infty$ function. That includes closed intervals, a convergent sequence, a Cantor set, ...
Sure. Just take any smooth function with compact support. The set where it is zero is $\mathbb{R}$ minus a compact set, which is uncountable.