# Does there exist a continuous function from the set of reals onto$[-1,1]$?

Does there exist a continuous function from $[-1,1]$ onto the set of reals numbers?

No, because by intermediate value property the image of a closed and bounded set is closed and bounded. But, my question is: Does there exist a continuous function from set of reals onto $[-1,1]$?

• $x\mapsto \sin x$ is onto – Hagen von Eitzen Jun 16 '17 at 13:11
• There are many continuous functions from $[-1, 1]$ to the set of reals. For instance, $f(x) = x$ is one. If you want a continuous, surjective function, then that's a completely different story. – Arthur Jun 16 '17 at 13:13
• Wat about from set of reals to [-1,1]? – Naveen malagi Jun 16 '17 at 13:15
• @Naveenmalagi $f(x) = 0.5$ is continuous, and it even works both ways. – Arthur Jun 16 '17 at 13:17
• I edited the question...kindly see the question once again – Naveen malagi Jun 16 '17 at 13:20

The interesting thing is about what can't happen. There are definitely continuous functions from $\mathbb{R}$ to $[-1,1]$ (i.e. their range is confined there). There are also continuous functions from $\mathbb{R}$ onto $[-1,1]$ (i.e. their range is $[-1,1]$). These two are exemplified by $\sin(x)$.

There are also injective continuous functions from $\mathbb{R}$ into $[-1,1]$ (i.e. their range is confined there). This is exemplified by $\tanh(x):=\frac{e^x-e^{-x}}{e^x+e^{-x}}$.

But there are not injective continuous functions from $\mathbb{R}$ onto $[-1,1]$. Such a function is either a homeomorphism (impossible: $\mathbb{R}$ is not compact and $[-1,1]$ is) or has a discontinuous inverse (also impossible because of a property particular to $\mathbb{R}$ and intervals).

Notably, it is easy to lose this particular property of $\mathbb{R}$ and intervals. For example there is a continuous injective function from $[0,2\pi)$ onto the unit circle, and yet $[0,2\pi)$ is not compact whereas the circle is.

Yes! The sine and cosine functions are functions from the set of reals to [-1, 1]!

$\sin x \in [-1, 1]$ $\forall x \in \mathbb{R}$

Also,

$\cos x \in [-1, 1]$ $\forall x \in \mathbb{R}$

These functions are continuous throughout the domain $\mathbb{R}$.

I hope you are satisfied with this answer!

The set $[-1,1]$ is compact. By the Weirstrass theorem, if $f:[-1,1]\to \Bbb R$ is continuous, then its image is also compact. As $\Bbb R$ is not a compact set, we conclude that $f$ can not be "onto" $\Bbb R$.