I am searching for a function f: R -> R which has exactly two preimages for every y.
I was thinking about stuff like
x^2 but this function doesn’t have preimages for y<0 and furthermore, there is just one preimages for y=0.
So I came to the idea, that a function like that cannot be continuous (might be an interesting thing to prove that).
Does anyone have a nice example for a function f like that?