If $f$ is any real-valued function, we define its zero set $Z\_f = \{ x : f(x) = 0 \}$. Obviously, the zero set of a nice function can be uncountable. e.g., if $f(x) = 0$ on an uncountable domain. 


I would like a sufficient condition on functions $f : \mathbb R \to \mathbb R$ for which the following statement holds: $$\mbox{if $Z\_f$ is uncountable, then it contains an interval}.$$


If $X\_t$ denotes a Brownian motion, then with probability one, the zero set of $X\_t$ is homeomorphic to a Cantor set (hence is uncountable but contains no interval). Since $X\_t$ is $\tfrac{1}{2}$-Hölder continuous, this is obviously not sufficient.


**Edit:** Due to Joel David Hamkin's elegant counterexample below, continuous differentiability is not a sufficient condition for the above statement to hold. Is there a natural sufficient condition?


**Edit 2:** Thanks, all. I've accepted Joel's answer because it doesn't seem like there is a solution to my problem at this level of generality. The motivation for the question comes from stochastic geometry. I take a realization of a random Riemannian metric $g$ on the Euclidean plane, and consider a certain geodesic $\gamma$. Such a curve is (a.s.) smooth but certainly not analytic.


Given the random environment $g$, the path of the geodesic is determined. I then look at the intersection of the geodesic with a given line segment or circular arc. This intersection could be empty, finite, countably infinite, or uncountable. Under the hypotheses in my model, I have already shown that it cannot be an interval. I was hoping that a general argument would reduce other cases of uncountability to that case, proving that the intersection is countable. I may just have to deal with the possibility it can be uncountable, or find a context-specific argument.



On the uncountability of zero sets
The distance function to a closed set is continuous, even Lipschitz continuous, and is zero exactly on that closed set. A modified version of this function can be made continuously differentiable, by smoothing out the kinks. In the case of the Cantor set, this provides a counterexample to your latter questions. 


