Sard's theorem and Cantor set

It is not hard to construct a smooth function $f$ on $\mathbb R$ such that $f \ge 0$ with $f(x) = 0$ if and only if $x$ is in the Cantor set $E$. If $F$ is an antiderivative of $f$, the critical values of $F$ will be an uncountably infinite perfect set.


By a theorem of Whitney (easy in this 1-dimensional case), any compact subset K in the interval I is the set of zeroes of a smooth (C infty) nonnegative function f. As Robert said, take a primitive F. Provided that K has no interior point, the critical values F(K) of F are homeomorphic with K.