0

I know that there are injective functions from $\mathbb{R}$ to $(0,1)$ that take all the values in $(0,1)$ for one $x$ (that is, with image $(0,1)$). For example this one:

$$f(x)=\frac{e^x}{e^x+1}, \ \ x\in\mathbb{R}$$

But I can't think of an injective function defined in $\mathbb{R}$ that has $[0,1]$ as its image. Does such a function exist and if not, why?

  • It won't be continuous, but such functions do exist. I think on this site you can find examples of bijections from $(0,1)$ to $[0,1]$, so you would just need to compose your function with such an example. See this example to construct such a bijection. – Clayton May 29 '19 at 18:44
  • Sure, just compose your $f$ with any bijection from $(0,1)$ to $[0,1]$. There's a standard trick to find one of those. – user4894 May 29 '19 at 18:45

2 Answers2

2

Maybe this function will work

$f(x)=\frac{1}{2}+\frac{\arctan x}{\pi}$ if $x\notin\mathbb N$

$f(1)=0$, $f(2)=1$ and $f(n+2)=\frac{1}{2}+\frac{\arctan n}{\pi}$ for $n\in\mathbb N$

0

Consider any bijective function $g:\Bbb R\to (0,1)$. For example $g(x)=e^{-e^{-x}}$.

Map every irrational $u$ to $g(u)$.

Let $\{a_n\}$ a sequence of all rationals and $\{b_n\}$ a sequence of all rationals of $[0,1]$. Map $a_n$ to $g(b_n)$.

ajotatxe
  • 65,084