For educational purposes, I need a function $f:\Bbb R\to \Bbb R$ that meets the following properties, or a proof that it doesn't exist:
- Continuous.
- For every $x\in\Bbb R$, $f^{-1}(\{x\})$ is infinite and bounded.
I have been thinking on the problem for a while, and intuition tells me that such a function doesn't exist, but I'm not sure where to begin to find a proof.
Hints for a proof or a counterexample (or a reference for it) are welcome.
Let $h: [0,1]\to [0,1]\times [0,1]$ be a surjective continuous function such that $h(0)=(0,0)$, $h(1)=(1,1)$. Extend this function to a map $$ H: {\mathbb R}\to {\mathbb R}^2 $$ so that $$ H(t+ n)= H(t) + (n,n) $$ for every $n\in {\mathbb Z}, t\in {\mathbb R}$. Lastly, take $f$ to the the composition of $H$ with the coordinate projection to the $y$-axis.