Show that there's no continuous function that takes each of its values $f(x)$ exactly twice.
For each $y \in \mathbb{R}$ either no $x$ with $f(x) = y$ or two such values of $x$. Show that $f$ is discontinuous.