Consider the space $$A = \left \{0,1,\frac 1 2, \frac 1 3, \cdots \right \} \subseteq I\ (= [0,1]).$$ Then $(I,A)$ doesn't have homotopy extension property.
Our instructor elaborated it in the following way $:$
If $(I,A)$ has the homotopy extension property then there exists a retraction $r : I \times I \longrightarrow (I \times \{0\}) \cup (A \times I).$ Now let us take $(0,1) \in (I \times \{0\}) \cup (A \times I)$ and take a neighborhood $U$ of $(0,1).$ Then $r^{-1} (U)$ contains a neighborhood $B$ of $(0,1)$ in $I \times I,$ which looks like a section of a ball in $\Bbb R^2$ containing $(0,1)$ Since $\frac {1} {n} \to 0$ it follows that there exists $m \geq 1$ such that $\left (\frac {1} {m}, 1 \right ) \in B.$ Since $B$ is convex there exists a line segment $\gamma$ in $B$ joining $\left (\frac {1} {m},1 \right )$ to $(0,1)$ in $B.$ So $r(B)$ should contain a path $(r \circ \gamma)$ from $(0,1)$ to $\left (\frac {1} {m}, 1 \right )$ in $U,$ which is a contradiction. I don't understand why doesn't there exist any path in $U$ which connects $(0,1)$ with $\left (\frac {1} {m},1 \right ).$ I think if we take $U$ small so that it doesn't intersect $I \times \{0\}$ then there wouldn't be any path joining $\left (\frac {1} {m}, 1 \right )$ to $(0,1)$ in $U.$ Am I right in my reasoning?
Any suggestion will be welcomed. Thank you very much.
EDIT $:$ Just now a proof came to my mind which is as follows $:$
Take $U$ in such a way that $U$ doesn't intersect $I \times \{0\}.$ Let there be a path $\gamma : [0,1] \longrightarrow U$ connecting $(0,1)$ and $\left (\frac {1} {m},1 \right )$ with $\gamma(0) = (0,1)$ and $\gamma(1) = \left (\frac {1} {m},1 \right ).$ Let $P$ be the projection of $\Bbb R^2$ onto the $x$-axis.Then $P \circ \gamma$ is continuous and it's image lies in $A$ since the image of $\gamma$ lies in $U \subseteq A \times I$ (as $U$ is disjoint from $I \times \{0\}$). But the only non-empty connected subsets of $A$ are singletons and hence the range of $P \circ \gamma$ is singleton as continuous image of a connected set (here $[0,1]$) is connected. But $(P \circ \gamma) (0) = P((0,1)) = 0$ and hence $(P \circ \gamma) ([0,1]) = \{0\},$ which is a contradiction since $$(P \circ \gamma) (1) = P \left (\left (\frac {1} {m},1 \right ) \right ) = \frac {1} {m} \neq 0.$$