0
$\begingroup$

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...

1 Answers 1

1

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.