I read that a continuous function can't take each of it's values exactly twice. But I don't understand why e.g. take the function $x^2$ and add one point to it very close to $0$ that also has $0$ value (and shift the rest of the function with the difference between the $x$-coordinate of the added point and $0$), then it takes each value twice. Or is it not continuous in this case?
Also could you give me a function in R that takes each of its values three times?