Construct a function that takes any value even number of times. I'm looking for a continous function $f: [0,1] \to \mathbb{R}$ such that it takes any value even (thus finite) number of times.
I suppose that it exists in the class of Lipschitz functions. All my approaches have led to some value which is taken infinite number of times. 
 A: Such a function can't be continuous, as the image of a compact set under a continuous function is compact. In this example, $[0, 1]$ is compact, while $\mathbb{R}$ is not.
However, the existence of such a function can be easily shown. From basic cardinality results it is known that bijections between $[0, \frac{1}{2}]$ and $\mathbb{R}$ resp. between $(\frac{1}{2}, 1]$ and $\mathbb{R}$ exist. Combining these functions yields a function with the desired property.
A: If you are still interested, I have a partial proof for this:
Let $A$ be the set of the local maximums of $f$ and $B$ be the set of its local minimums.
First case: $f(0) \neq f(1)$:
Given that $]f(0);f(1)[$ is uncountable, and $f(A\cup B)$ is countable (see here if you're not convinced:link), I can find $a \in ]f(0);f(1)[$ verifying $a \notin f(A\cup B)$. Given the definition of $a$, every time $f-a$ hits $0$, its sign changes. However, $(f-a)(0)$ and $(f-a)(1)$ are of opposite signs, hence $f-a$ hits $0$ an odd number of times, so $f$ takes the value $a$ an odd number of times.  
Tricky case: $f(0)=f(1)=0$:
We can assume that $f(0+)$ and $f(1-)$ are of the same sign, since otherwise we can use the same argument as the first part. So from now we'll consider the case where they are both positive.
Sub-case 1: $A$ and $B$ are finite: Then, since we know that $f$ is increasing around $0$ and decreasing around $1$, $|A\cup B|$ is odd, so we can choose a value $a$ verifying $|\{x \in A\cup B|f(x)=a\}|$ is odd. Given that definition, $f$ takes the value $a$ an odd number of times.
Sub-case 2: $A$ and $B$ are infinite.
I don't know how to handle this sub-case. (I think one has to use the Bolzano-Weierstrass theorem on A and B, and somehow use the continuity of $f$, but I can't quite make this work.)
