I am mimicking the argument of Hatcher here from example $0.15$ of page no. 15. What the author says is as follows $:$
To verify the homotopy extension property, notice first that $I \times I$ retracts to $(I \times \{0\}) \cup (\partial I \times I),$ hence $B \times I \times I$ retracts to $(B \times I \times \{0\}) \cup (B \times \partial I \times I),$ and this retraction induces a retraction of $M_f \times I$ onto $(M_f \times \{0\}) \cup ((A \cup B) \times I).$
It's not quite clear to me that how does this induced retraction is obtained. I don't know why Hatcher explained important results reluctantly without any rigour. I am trying to think in terms of the following pushout diagrams. The mapping cylinder $M_f$ of $f$ can be given in terms of the following pushout diagram.
$$\require{AMScd} \begin{CD} B @>{i\ :\ b\ \mapsto\ (b,0)}>{}> B \times I \\ @V{f}VV @VV{\overline {f}}V\\ A @>{\overline i}>{\text {}}> M_f \end{CD}$$
The above pushout diagram gives rise to a pushout diagram of the following form $:$
$$\require{AMScd} \begin{CD} B \times I @>{i \times \text {id}_I\ :\ (b,t)\ \mapsto\ (b,0,t) }>{}> B \times I \times I \\ @V{f \times \text {id}_I}VV @VV{\overline f \times \text {id}_I}V\\ A \times I @>{\overline i \times \text {id}_I}>{\text {}}> M_f \times I\end{CD}$$
So in order to get a map $r : M_f \times I \longrightarrow (M_f \times \{0\}) \cup ((A \cup B) \times I)$ we need only to get hold of maps $j_1 : B \times I \times I \longrightarrow (M_f \times \{0\}) \cup ((A \cup B) \times I)$ and $j_2 : A \times I \longrightarrow (M_f \times \{0\}) \cup ((A \cup B) \times I)$ such that $j_1 \circ (i \times \text {id}_I) = j_2 \circ (f \times \text {id}_I).$
Would anybody please help me finding $j_1$ and $j_2\ $? If there is any easier way to approach the problem, I would be happy to learn that also.
Thank you very much.