Why is this map continuous? (Cofibrations) Assume that we have a map $i : A \rightarrow X$ which is a (closed) cofibration and a homotopy equivalence. Then, $A$ is a strong deformation retract of $X$ and there is a function $u: X \to I$ such that $u^{-1}(0) = A$. Now, let $r: X\to A$ be the retraction and $H$ the homotopy contracting $X$, constant on $A$. Then, it is claimed that we can deform $H$ to another homotopy $j$ by the rule
$$j(x,t) = H(x,t/u(x)) \text{ if } t < u(x)$$
and $$j(x,t) = H(x,1) \text{ if } t \geq u(x).$$
However, why is this $j$ continuous? If both the domains were closed, we would be done, but they aren't. Is there any other slick way to do this? I have tried to extend them to their closure but I can't seem to make it work out nicely.
 A: The domain $D$ of the first function is the preimage of the open set $(0,\infty)$ under the continuous map $f(x,t)=u(x)-t$, thus $D$ is open. The closure $\overline D$ is then a subset of $D':=f^{-1}[[0,∞)]$, which is the closed set $D'=\{(x,t)\in X\times I\mid t\le u(x)\}$. If we extend $j$ continuously to $D'$, then we can glue it with the second map, provided that we extended it in a compatible way. The only possible extension is:
$$\bar j=\begin{cases}
H(x,t/u(x)), &\text{ if }t\le u(x),\ 0<u(x)\\
H(x,1)=r(x)=x, &\text{ if }x\in A,\ t=0
\end{cases}$$
Here $\bar j:D'\to X$ restricts to $j$ on $D$, and it is compatible with the second function. Clearly $\bar j$ is continuous on $X\setminus A\times I$ and on $\text{int}A\times 0$, so we only need to check continuity for a point $(a,0), a\in\partial A.$

Lemma: Let $X$ be a space, $A\subset X$, and $H:X\times I\to X$ a homotopy such that $H(a,t)=a$ for $a\in A.$ If $V$ is open, then there is an open $W\subseteq V$ such that $V\cap A\subseteq W$ and for every $w\in W$ the path $H(w,t)$ is contained in $V$.

Let us take an open neighborhood $V$ around $a=\bar j(a,0)$. We have to find a neighborhood $W\times[0,\delta)$ of $(a,0)$ such that $\bar j[W\times[0,\delta)]\subseteq V$. Now, by the lemma there is an open $W\subseteq V$ such that $H[W\times I]\subseteq V$. This is just the neighborhood we need.
