# How to show $E:=\{x\in [0,1]: |f^{-1}(\{x\})|\,\mbox{ is even} \}$ is countable?

Hi everybody
I have seen the following question which I could not solve it, so I thought I can share the question with you and ask for help.

Question: Let $f:[0,1]\to [0,1]$ be a continuous function such that $f(0)=0$ and $f(1)=1$. Moreover assume $f^{-1}(\{x\})$ is finite for all $x$. Prove $$E:=\{x\in [0,1]: |f^{-1}(\{x\})|\,\mbox{ is even} \}$$
is countable.

-
Interesting. It feels like you need to show that if $x\in[0,1]$ then there is a $\delta$ such that $f$ is $1-1$ on $(x-\delta,x)$ and on $(x,x+\delta)$ (excluding one side for $x=0,1$, of course.) Essentially, either $f(x)$ is a (relatively simple) local max- or minimum, or $f$ is $1-1$ on $(x-\delta,x+\delta)$ –  Thomas Andrews May 28 '11 at 15:45
My immediate impulse was to try and use degree theory. This should boil down to the change of variables formula in the end (Heinz integral formula for the degree), but I don't really see how to make that into a precise argument at the moment. –  t.b. May 28 '11 at 16:15
By virtue of the mean value theorem, the values between two consecutive preimages of $x$ are either all greater or all less than $x$. For $|f^{-1}(\{x\})|$ to be even, there has to be at least one preimage of $x$ for which the values are greater on both sides or less on both sides; i.e. this preimage is a local extremum. For $E$ to be uncountable, there would have to be uncountably many such local extrema, and hence uncountably many local maxima or uncountably many local minima. I don't know how to go on from there. –  joriki May 28 '11 at 16:34
I would like to ask user1112 from where did he get this problem? What book is it in? –  Beni Bogosel May 29 '11 at 3:47

Building on my comment: For a local maximum $y$ with function value $f(y)$, let $\rho(y)$ be the radius within which all function values are less than $f(y)$. Let $\rho_n=1/n$, and consider the local maxima with $\rho_n\ge\rho(y)>\rho_{n+1}$. There can't be more than $n$ of these, since their radii can't overlap. So we can enumerate all local maxima (and analogously all local minima).