# Does there exist a continuous injection from $[0,1)$ to $(-1,1)$?

Does there exist a continuous injective or surjective function from $[0,1)$ to $(-1,1)$ ? I know there is no continuous bijection from $[0,1)$ to $(-1,1)$ , but am stuck with only injective continuous or surjective continuous . Please help . Thanks in advance

• Have the intervals the subspace topology induced by $\mathbb{R}$? – InsideOut Mar 12 '16 at 13:51
• I've updated my answer to include both a continuous injection and a continuous surjection. $\qquad$ – Michael Hardy Mar 13 '16 at 15:51

I think next two functions are continuous and:

$f(x) = x$ is injective but not surjective

$g(x) = x * \sin(1/(1-x))$ is surjective but not injective

• I'm not really sure about g...maybe there is $\pi$ in the argument of sin – InsideOut Mar 12 '16 at 13:57
• Nice $g$ for the surjective case! (it works because the sin will oscillate more and more rapidly, and closer and closer to $-1$ and $1$ as $x\rightarrow 1$). – Justin Benfield Mar 12 '16 at 13:58
• @GianlucaFaraco You don't need $\pi$ . As soon as $x$ is close enough to $1$, just continue until $x$ is multiple of $\pi / 2$, also 0 can be in the range.. – Pieter21 Mar 12 '16 at 14:02
• @Pieter21 : How is $g$ surjective ? – user228169 Mar 12 '16 at 14:11
• @user228169, it not difficult, but I'm not telling either. Your question looks like homework, and you have to learn something by figuring it out yourself. The remark of Justin, and the definitions of surjective and continuous should be enough to figure it out. – Pieter21 Mar 12 '16 at 14:19

$$f(x) = x.$$ This is a continuous injection from $[0,1)$ onto $[0,1)$ and so a continuous injection from $[0,1)$ into $(-1,1)$.

For a continuous surjection, let's do it piecewise. Say a function $g$ is piecewise linear and $g(0)=0$, $g(1/2) = 0.9$, $g(3/4)=-0.9$, $g(7/8) = 0.99$, $g(15/16) = -0.99$, $g(31/32) = 0.999$, $g(63/64)=-0.999$, and so on. The image of this continuous function is all of $(-1,1)$.