Real Analysis – Continuous Function from (0,1) onto [0,1]

real-analysis

While revising, I came across this question(s):

A) Is there a continuous function from $(0,1)$ onto $[0,1]$?

B) Is there a continuous one-to-one function from $(0,1)$ onto $[0,1]$?

(clarification: one-to-one is taken as a synonym for injective)

I figured the answer to A is yes, with $\frac{1}{2}\sin(4\pi x)+\frac{1}{2}$ as an example.

The answer to part B is no, but what is the reason?

Sincere thanks for any help.

Best Answer

There isn't such a function. If $f$ is such a function, then $f$ is monotonic, and $f^{-1}$ too. But a monotonic function defined on an interval is continuous iff its range is an interval. So we have that $f$ is an homeomorphism from $(0,1)$ to $[0,1]$, which is impossible since one is compact and the other is non compact.

Related Question