More generally, can the zero set $V(f)$ of a continuous function $f : \mathbb{R} \to \mathbb{R}$ be nowhere dense and uncountable? What if $f$ is smooth?


Some days ago I discovered that in this proof I am working on, I have implicitly assumed that $V(f)$ has to be countable if it is nowhere dense - hence this question.



Can Cantor set be the zero set of a continuous function?
Here's a semi-explicit construction for a smooth function f that is zero precisely on the classical Cantor set. By this set I mean the one that is obtained from $I\_0 = [0,1]$ by repeatedly removing the middle third of any ensuing interval. So let's denote by $I\_n$ the
$n$-th set in this process.


Now let's make a smooth function $f\_n$ on $[0,1]$ such that its zero set is exactly $I\_n$.
Starting with $f\_0 = 0$ we obtain $f\_{n+1}$ from $f\_n$ as follows:


Set $f\_{n+1} = f\_n$ on $I\_{n+1}$ and
on an interval that is removed from $I\_n$ make $f\_{n+1}$ equal to a bump function
that is 0 only at the boundary of the interval. We can choose the bump function to be of height $2^{-2^n}$.


This choice of heights of the bump functions will ensure that 
the derivatives of $f$ all converge uniformly to their pointwise limits.
Hence the limit function $f\_n$ is again smooth. By construction its zero set is exactly
the Cantor set. 


