TITLE: Exceptional values of real-valued functions on [0,1]
QUESTION [8 upvotes]: Given a continuous real-valued function $f$ from $[0,1]$ to itself with $f(0)=0$ and $f(1)=1$ such that $f^{-1}(c)$ is finite for all $c$ in $[0,1]$, let $E(f)$ be the set of $c$ in $[0,1]$ such that $|f^{-1}(c)|$ has (positive) even cardinality. Call a subset of $[0,1]$  an exceptional set if it is of the form $E(f)$ for some $f$ satisfying the stated conditions. How big can an exceptional set be? I intend "big" to be vague; you can interpret it in the sense of cardinality,  measure, category, or Hausdorff dimension. It is not hard to construct an exceptional set that is countably infinite (I believe this is an exercise in Spivak's calculus book).

REPLY [6 votes]: $E(f)$ is at most countable. An elementary argument based on the intermediate value theorem shows that any $c\in E(f)$ must be the value of a (strict) local extremum of $f$, at one of the points where this value is taken. However, if $c$ is a local maximum, say, then we can find $a,b\in\mathbb Q$ which let us recover $c$ as $c=\max_{a\le x\le b}f(x)$, so there are only countably many such values $c$.