I have to show that $(0,1) \simeq [0,1] $ but not homeomorphic, where $\simeq $ means homotopically equivalent.
I have done the not homeomorphic part by showing that $(0,1)$ is not compact but $[0,1] $ is compact.
Now the problem is that how to show that they are homotopically equivalent, i.e. $$ f:(0,1)\rightarrow [0,1]\ \text{and } g:[0,1]\rightarrow (0,1) $$ are two continuous function s.t. $$ gf\simeq1_{(0,1)}\ \text{and} fg\simeq 1_{[0,1]} $$ where $ 1_{(0,1)} $ and $1_{[0,1]}$ are respective identities.
Both intervals deformation retract onto any point within, say $1/2$ for simplicity. Indeed, just define $f_t(x) = (1-t)(x-1/2)+1/2$ (whether the domain for $x$ is $(0,1)$ or $[0,1]$). Clearly $f_0 = \mathit{id}_\text{interval}$, $f_1 \equiv 1/2$, and $f_t(1/2) = 1/2$ for all $t \in [0,1]$. This provides a homotopy equivalence between either interval and $\{ 1/2 \}$ because we have shown that $i \circ p \simeq_f \mathit{id}_\text{interval}$, where $p$ is the projection of either interval on the singleton $\{1/2\}$ and $i$ is the inclusion of $\{ 1/2 \}$ into either interval. (And of course $p \circ i = \mathit{id}_{\{1/2\}}$.)