## Continuous bijection from (0, 1) to [0, 1]

I think the following is a good exercise for first course in real analysis.

Does there exist continuous bijection from $(0, 1)$ to $[0, 1]$?               (1)

Well, it feels like the answer should be “no”. At least if the question was

Does there exist continuous bijection from $[0, 1]$ to $(0, 1)$?               (2)

the answer would be a trivial “no”. Continuous image of compact set is compact; in particular, $[0, 1]$ is compact, and $(0, 1)$ is not compact, so continuous bijection from $[0, 1]$ to $(0, 1)$ cannot exist. So it is natural to wonder how questions (1) and (2) are related. If $f: (0, 1) \to [0, 1]$ is a continuous bijection, then $f^{-1}: [0, 1]\to (0, 1)$ is well-defined function. But, if in addition, $f^{-1}$ is known to be continuous, then once again we have a continuous bijection from $f^{-1}: [0, 1]\to (0,1)$ which we know is impossible. For general reference:

Definition. When $f: X\to Y$ is a continuous bijection, and $f^{-1}$ is continuous, then we say that $f^{-1}$ is homeomorphism from $X$ to $Y$.

Thus, being homeomorphic is a stronger property than being continuous and bijective. Roughly speaking, homeomorphisms preserve all intrinsic topological properties (e.g. compactness), just like how group homomorphisms preserve the group structure. To naively answer question (1), it would be very good to know when continuous bijections are homeomorphisms. Because if continuous bijections were always homeomorphisms, then the answer to question (1) is definitive “no” by what we explained above. Unfortunately, that’s not always the case. But not all is lost. We have the following sufficient condition:

Theorem. If $f: X\to Y$ is continuous bijection, where $X$ is compact and $Y$ is Hausdorff, then $f$ is a homeomorphism.

But the domain of $f$ is $(0,1)$, so we can’t apply the above theorem. What a pity! After much teasing, I think it would only be fair to present the complete answer:

Solution to Question (1). Suppose that $f: (0, 1)\to [0, 1]$ is a continuous bijection. Then there exists a unique $x\in (0,1)$ such that $f(x)=1$. Let $\epsilon>0$ be so small that $(x-\epsilon, x+\epsilon)\subseteq (0, 1)$. So the intervals $[x-\epsilon, x]$ and $[x, x+\epsilon]$ get mapped under $f$ to intervals $[a, 1]$ and $[b, 1]$, respectively for some $a, b\in [0, 1)$. But then every value in $(\max(a, b), 1)$ would be achieved at least twice by $f$, contradiction.

Acknowledgement. I learnt the above proof from t.b.’s answer here:

http://math.stackexchange.com/questions/42308/continuous-bijection-from-0-1-to-0-1

Other proofs given in that thread are also very nice.