Whether there is a continuous bijection from $(0,1)$ to closed interval $[0,1]$. [duplicate]

Is there a continuous bijection from open interval $(0,1)$ to $[0,1]$. The answer is not. How to prove?

I think it may proceed by contradiction and apply open mapping theorem. However, $(0,1)$ is not complete. I get stuck.

marked as duplicate by J.R., 5xum, bof, Mark Bennet, AdrianoSep 25 '14 at 8:16

Let $f\colon (0,1)\to [0,1]$ be continuous and onto and $f(c)=1$ with $0<c<1$. Let $a=\frac c2$ and $b=\frac{1+c}2$. If $f(a)=1$ or $f(b)=1$, clearly $f$ is not injective. If both $f(a)<1$ and $f(b)<1$, pick $y\in(\max\{f(a),f(b)\},1)$ and note by IVT that there are $x_1\in(a,c)$ and $x_2\in(c,b)$ with $f(x_1)=f(x_2)=y$. At any rate, $f$ is not injective.