2

Is there a continuous function from $\mathbb{R}\to\mathbb{R}$ that reaches all of its possible values (each value in it's range) exactly $2$ times (for example, $x^2$ would be perfect if it wasn't for $0$..). Also, the same question but $3$ times.

I'm almost certain that there aren't such functions but who knows haha maybe there are a bunch...

StackeandoAndo
  • 419
  • 3
  • 8
  • See in particular : https://math.stackexchange.com/q/677085 – Jean Marie Apr 04 '19 at 21:31
  • 1
    I think the extra question about 3 times stops it being a duplicate of the second and third of those questions (and it's clearly not a duplicate of the first since the answer to that doesn't help here). – Especially Lime Apr 04 '19 at 21:31
  • 1
    For “three times” it is answered here: https://math.stackexchange.com/questions/735842/function-f-mathbbr-to-mathbbr-that-takes-each-value-in-mathbbr-th. – Martin R Apr 04 '19 at 21:32
  • @EspeciallyLime: Not sure why you think that the answer to the first one does not help. It says "On the other hand, it is impossible for every point in the range of $f$ to have the same even number of preimages." – Martin R Apr 04 '19 at 21:34
  • @MartinR I meant the actual answer to the linked question, which is "yes", does not help. – Especially Lime Apr 04 '19 at 21:37

1 Answers1

2

I don't think there can be for $2$. To see this, suppose there is sucha function $f$ and consider two points $x_1,x_2$ where it takes some given value $y$. Between these points $f(x)$ is either always greater than $y$ or always less. Without loss of generality assume the former. Now there is some maximum value $z$ taken between these points, which is attained because $f$ is continuous. $z$ can only be taken at one point inside the range (since otherwise the function is constant on an interval, contradiction), but also every the function must be less than $y$ outside the interval since otherwise some value slightly more than $y$ would be taken three times. This means $z$ is only taken once, contradiction.

There is such a function for $3$. One example is the function defined by the following properties:

  1. $f(0)=0$, $f(1)=1$, $f(2)=0$, $f(3)=1$, $f(4)=2$, $f(5)=1$, $f(6)=2$, $f(7)=3$, $f(8)=2$ and so on (after the first step it just repeats down, up, up)
  2. $f$ is linear between integer values
  3. $f$ is an odd function.