Sard's famous theorem asserts that

**Theorem.** The set of critical values of a smooth function from a manifold to another has Lebesgue measure $0$.

I am asking for the curiosity that is it possible to find such a function whose set of critical values is

- Cantor set or
- Any other uncountably infinite set?