Prove that there does not exist a continuous function over reals for which it takes on every value exactly twice 
Prove that there does not exist a continuous function over reals for which it takes on every value exactly twice. Can we replace two by four?  an even number?

Note: By critical point here I mean one that goes from increasing or decreasing or decreasing to increasing (not like $x^3$).
Attempt
Firstly I am confused by what "every value" means. Does that mean every real number or every value in the range of the function? If it is the latter, we can prove the first statement first. Assume there does exist such a function that takes on every value exactly twice. Then for every $f(x)$ there exists $x_1$ and $x_2$ such that $x_1 \neq x_2$ and $f(x_1) = f(x_2)$. Thus given any $f(x_1)$ there exists exactly one other number $x_2 \neq x_1$ such that $f(x_1) = f(x_2)$. 
To show this is impossible, first note that the function must have at least one critical point. But if it does have critical point that critical point will only get counted once so we must have another critical point somewhere. Therefore we will have counted every point $3$ times. Thus it is impossible for a continuous function over reals for which it takes on every value exactly twice.
Proving the general case as the question suggests shouldn't be much more difficult. I am wondering if my reasoning is sound or do I need to make it more rigorous. It makes sense to me when I graph it but I am wondering if I need to tweak my solution.
 A: The argument does not quite make sense. However, the following argument is philosophically related and correct:
There exist $x_1, x_2,$ such that $f(x_1) = f(x_2).$ Since $f$ is continuous, it achieves its maximum in $[x_1, x_2]$ at $y.$ Every value sufficiently close to $c=f(y)$ is achieved twice (in the small interval around $y$). Now, let $y_1$ be such that $c=f(y_1) = f(y).$ It must be true that $y_1$ is a local minimum of $f$ (since otherwise some value will be achieved three times). Without loss of generality, assume $y_1 > y.$ Then, there is an $\epsilon,$ such that $f(y_1-\epsilon) < c,$ while $f(y+\epsilon) > c.$ By the intermediate value theorem, there is a $z\in [y+\epsilon, y_1 - \epsilon],$ such that $f(z) = c$ - contradiction.
A: I think you need a little bit of tweaking, which would take the form "Let a be some value the function assumes.  Then there exist x, y, wlog x < y such that f(x) = a = f(y)"  The remainder of your argument will then work, although I think you should word the handling of critical points a bit more carefully.
The same argument should also work for any fixed or bounded even number of times.
A: First note that $f$ must go from increasing to decreasing or decreasing to increasing in any case. Thus, the apex point is only counted once unless we have another critical value in which case it will be counted twice. Although, this is impossible since any function that goes from decreasing to increasing to decreasing or increasing to decreasing to increasing will count some $3$ times.
Lemma $1$. Such a function $f(x)$ must go from decreasing to increasing to decreasing or increasing to decreasing to increasing.
Proof. If $f(x)$ is strictly decreasing, it will never achieve the same value more than once since $f(a) > f(b)$ for any $a < b$ in $\mathbb{R}$. Similar reasoning applies when $f(x)$ is strictly increasing. Thus, $f(x)$ must go from decreasing to increasing or decreasing to increasing at least once.
Lemma $2$. Any continuous function $f(x): \mathbb{R} \to \mathbb{R}$ that goes from  decreasing to increasing to decreasing or increasing to decreasing to increasing will have exactly three values $x_1 < x_2 < x_3$ such that $f(x_1) = f(x_2) = f(x_3)$.
Proof. Assume WLOG that $f(x)$ is decreasing on $(-\infty,a)$, increasing on $[a,b)$, and decreasing on $[b,c)$. Since $f(x)$ goes from decreasing to increasing, it must hit a critical point at $x_0$. On $(-\infty,a)$, $f(a)< f(x) < \infty$ and on $[a,b)$ we have  $f(a) < f(x) < f(c)$. Thus since $f(x)$ is continuous any value of $f(x)$ we pick on $[a,b)$ will also be a value of $f(x)$ on $(-\infty,a)$. So we have $f(x_1) = f(x_2)$ for $x_1 \in (-\infty, a)$ and $x_2 \in [a,b).$ Similarly on $[a,b)$ we have $ f(a) < f(x) < f(b)$  and on $[b,c)$ we have $f(b) > f(x) > f(c)$. Thus there exists a value of $x_3$ such that $f(x_3) = f(x_2)$ since there is an $f(x)$ common to both $[a,b)$ and $[b,c)$.
In order to establish it generally, I am unsure how to proceed. Possibly by contradiction may work.
