Showing continuity of partially defined map There is a theorem in Note on Cofibrations by Arne Strøm. It says

Let $A$ be a closed subspace of a topological space $X$. Then $(X,A)$ has the HEP if and only if there are
  (i) a neighborhood $U$ of $A$ which is deformable in $X$ to $A$ rel$A$, i.e. there is an $H:U\times I\to X$ s.t. $H(x,0)=x,\ H(x,1)\in A,\ H(a,t)=a$
  for all $a\in A,x\in X,t\in I.$
  (ii) a map $\phi:X\to I$ s.t. $A=\phi^{-1}(0)$ and $\phi(x)=1$ for all $x\notin U$

To show that $(X,A)$ has the HEP, one constructs a retraction $X\times I\to A\times I\cup X\times\{0\}$. Such a one is given in the proof, namely: 
$$r(x,t)=\begin{cases}
(x,\ 0), &\text{ if }\phi(x)=1\\
(H(x,2(1-\phi(x))t),\ 0), &\text{ if }1/2\le\phi(x)<1\\
(H(x,t/(2\phi(x))),\ 0), &\text{ if }0<\phi(x)\le1/2,\ t\le2\phi(x)\\
(H(x,1),\ t-2\phi(x)), &\text{ if }0\le\phi(x)\le1/2,\ t\ge2\phi(x)
\end{cases}$$
Now, these partial functions could easily be glued to a single continuous function if the domains were closed, but they are not. So, in order to show continuity, especially on the union of the first two domains, that is on
$\phi^{-1}\left[\left[\frac12,1\right]\right]$, one takes an element $(x,t)$ and shows that the function is continuous at that point. Since
$\phi^{-1}[[0,1)]$ is an open subset of $U$ and the homotopy $H$ is only used for $\phi(x)<1$ in the construction of $r$, we can assume that $U=\phi^{-1}[[0,1)]$ and is open.
Let us define the map
$$s:\{x\in X\mid\phi(x)\ge1/2\}\times I\to X\times I\\
(x,t)\mapsto(x,2(1-\phi(x))t)$$
The image of $s$ is the set $S=\{(x,t)\mid t\le2(1-\phi(x))\le1\}$. Now, $r(x,t)$ can written as $(\tilde Hs(x,t),0)$ where $\tilde H:S\to X$ is defined by
$$\tilde H(x,t)=\begin{cases}
H(x,t)  &\text{ if }x\in U\\
x,  &\text{ if }t=0
\end{cases}$$ The map $s$ is continuous, so it would be enough to show continuity of $\tilde H$.
This is only nontrivial for $x\in\partial U.$ Then $x\notin U$ and $\phi(x)=1$, so $t=0$. I take an open neighborhood $V$ about $x=\tilde H(x,0)$ and try to find a neighborhood $W$ of $x$ such that $H[W\times I\cap S]\subseteq V$. But how can I find this $W$? Clearly, it must be a subset of $V$.
 A: Here's another attempt for the tricky case. Your particular concern is to show that the function $r$ extends continuously from $U$ to its boundary $\partial U$, since all the other cases are obvious. The problem is that $H$ is defined only on $U$.
So define:
$$U' = \phi^{-1}\left(\left[0, \frac{9}{10}\right)\right);$$
$$\phi': X \rightarrow [0,1], \quad x \mapsto \min \left(\frac{10}{9}\phi(x), 1\right);$$
$$H' = H \upharpoonright U' \times [0,1].$$
Then $(A, X, U', H', \phi')$ satisfies the hypotheses of the required result, and now we know that $H'$ extends continuously to $\partial U'$ and beyond. So, as this was the only oustanding problem, we can perform the desired construction of $r$ for $(A, X)$ continuously without loss of generality. Phew!
A: I am not really answering your question, but I give you my first impulse:
Why not defining $r\left(x,t\right)$ on the closed $\phi^{-1}[\frac{1}{2},1]\times\mathbb{I}$
by:
$\left(x,t\right)\mapsto(H(x,2\left(1-\phi\left(x\right)t\right),0)$?
We have $H\left(x,0\right)=x$ and consequently then $r\left(x,t\right)=\left(x,0\right)$
if $\phi\left(x\right)=1$. 
I don't see the necessity for an apart
clausule concerning the case $\phi\left(x\right)=1$.
Is this solving (a part of) your problem? Or am I overlooking something?
A: I got confused, when reading the question, over where you were referring to domain and where to the range. In particular, by the time you say "$x \not \in U$ and $\phi(x) = 1$, so $t = 0$", you must be thinking of $(x,t)$ as a member of the range, but earlier you are talking about continuity at the point $(x,t)$ in the union of the first two domains. Your description of the set $S$ as $S=\{(x,t)\mid t\le2(1-\phi(x))\le1\}$ may share this confusion, as it doesn't identify the $x$ values in its projection which are restricted by your definition of the domain of $s$. So I think it's better to start afresh. We can begin with an informal description of the function $r$.  

We're given the continuous deformation $H$ which contracts, as $t$ varies, the neighbourhood $U$ into $A$: at constant $t=0$ it's the identity, at $t=1$ the range is exactly the closed set $A$. We also have a continuous "measure of distance" from $A$, $\phi$, which takes value $0$ exactly on $A$ and is guaranteed to have its maximum value $1$ outside $U$. We may without loss of generality take $U = \phi^{-1}[0,1)$, in fact. 
A picture of the range of $r$ is like a top hat. It has a wide brim $X \times \{0\}$, and a vertically-edged crown $A \times [0,1]$. The domain of $r$ is a box for that hat, $X \times [0,1]$. What is the action of $r$?
Pick an $x$ in the projection of the domain (this corresponds 1-1 with points on the lid of the box), and look at what happens to $x \times [0,1]$. If $x$ is outside $U$, then $r$ is a vertical projection to $(x, t) \mapsto (x,0)$. 
The next section is the outer part of $U$, for which $\phi(x)$ is more than $1/2$. Here $r$ not only flattens the space in the box down to the brim, but starts slowly pulling it inwards. At the base of the box, $(x,0)$ is held in place: $r:(x,0) \mapsto (H(x,0),0) = (x,0)$; at the top $r(x,1)$ reaches $(H(x, 2-2\phi(x),0)$, a point still on the brim but closer to the crown. On the next border, $\phi = 1/2$ and the top of the box is mapped to  the bottom of the crown, a point in $A \times\{0\}$.
For the inner section of $U$, $r$ flattens the bottom section of the box into the brim as before, but increasingly fast, fast enough that $r(x,t)$ has reached the bottom of the crown with $t = 2\phi(x)$. Above that level, $r(x,t)$ starts climbing the wall of the crown, at a constant unit speed. In the limit as $x$ approaches $A$, we have $\phi(x) \rightarrow 0$, $H(x,1) \rightarrow x$, and the amount of $x \times [0,1]$ that is squashed to the base diminishes to zero while we cover more and more of $H(x,1) \times [0,1]$, ending at the identity map when $\phi(x) = 0$.
Finally, for $x$ inside $A$ where $\phi(x)$ remains $0$, $r(x,t)$ remains the identity map.
(Note though that while the vertical axis is the unit interval with the usual topology, the topology of $X$ is unknown so this idea of $x$ "approaching" $A$ is only heuristic. Instead we do know that $\phi(x)$ approaches $0$, in the unit interval topology. Note also that $H(x,1)$ is not guaranteed to be on the boundary of $A$ for $x \not \in A$, so some parts of the brim may be pulled inside the crown; still, $H$ is continuous)
From this picture I, at least, find it informally obvious that $r$ is continuous: given any $(x,t)$ the points nearby are moved to points near its image, and the segments of the definition all line up correctly.

Formally, suppose $(x', t')$ is in the range of $r$, and $(x',t') \in V'$ where $V'$ is open in the range of $r$ and is, without loss of generality, of form $\text{Ran}(r) \cap V \times {(t'-\epsilon, t'+\epsilon)}$ with $V$ open in $X$ . We need to show that if $r: (x_0,t_0) \mapsto (x',t')$ and $(x,t)$ is sufficiently close to $(x_0, t_0)$ then $r(x,t)$ is also in $V'$. 
There are a number of cases but they are all going to be much the same, except at the boundary of $U$ where we suddenly lose the help of $H$. On a rereading of the question I see that a solution there is all that's asked for, but here's a mechanical formal proof of one of the easy cases.
Suppose $\frac{1}{2} < \phi(x_0) < 1$. Then we can assume $V \subset U \times [0,1]$. We take the inverse image of $V$ under $H$, which is open by the continuity of $H$ and so must contain a rectangular neighbourhood of form $W \times [0,b)$, containing $(x_0, 2(1-\phi(x_0))t_0)$. By the continuity of $\phi$ there is a neighbourhood $W' \subset W$ of $x_0$, and some $\delta >0$, for which if $x \in W'$ and $|t - t_0| < \delta$ then $H(x, 2(1-\phi(x))(t)) \in V$. 
Hence $r$ is continuous on $\phi^{-1}((\frac{1}{2},1)) \times [0,1]$. (In the second coordinate everything here is mapped by $r$ to $0$, so continuity is trivial.)
[Edited to remove blunder by reducing the claim. At least what it says is now true, if unexciting. The important bit is now in another answer, since this is too long. I'll leave it up in the hope that the informal picture is helpful]
