Consider the pushout diagram in the category Top $:$
$$\require{AMScd} \begin{CD} A @>{f}>{\text {inclusion}}> B\\ @V{g}VV @VV{i_1}V\\ Y @>{i_2}>{}> X\end{CD}$$ Suppose that $(B,A)$ has HEP. Show that $(X,Y)$ also has HEP.
$\textbf {My attempt}$ $:$ We first note that $i_2$ is an inclusion since so is $f.$ Now since $(B,A)$ has HEP it follows that there exists a retraction $r : B \times I \longrightarrow (B \times \{0\}) \cup (A \times I).$ So in order to show that $(X,Y)$ has HEP we need to construct a retraction $s : X \times I \longrightarrow (X \times \{0\}) \cup (Y \times I).$ Now the above diagram of pushout induces a pushout of the following form $:$
$$\require{AMScd} \begin{CD} A \times I @>{f \times \text {id}}>{\text {inclusion}}> B \times I \\ @V{g \times \text {id}}VV @VV{i_1 \times \text {id}}V\\ Y \times I @>{i_2 \times \text {id}}>{\text {inclusion}}> X \times I \end{CD}$$
So by virtue of universal property of pushout, in order to get a map from $s : X \times I \longrightarrow (X \times \{0\}) \cup (Y \times I)$ it is enough to construct maps $j_1 :B \times I \longrightarrow (X \times \{0\}) \cup (Y \times I)$ and $j_2 : Y \times I \longrightarrow (X \times \{0\} \cup (Y \times I)$ such that $j_1 \circ (f \times \text {id}) = j_2 \circ (g \times \text {id}).$ Consider the map $\varphi : (B \times \{0\}) \cup (A \times I) \longrightarrow (X \times \{0\}) \cup (Y \times I)$ defined by $$\varphi(z)= \begin{cases} (i_1(b),0), & \text {if}\ z = (b,0),\ \text {for some}\ b \in B \\ (g(a),t), & \text {if}\ z = (a,t),\ \text {for some}\ a \in A\ \text {and}\ t \in I \end{cases}$$
Define $j_1 : = \varphi \circ r$ and $j_2 : = \text {id}_{Y \times I}.$ Then it is easy to see that $j_1 \circ (f \times \text {id}) = j_2 \circ (g \times \text {id}).$ So by universal property of pushout there exists a unique map $s : X \times I \longrightarrow (X \times \{0\}) \cup (Y \times I)$ such that the following holds $:$
$(1)$ $s \circ (i_1 \times \text {id}) = j_1$ and
$(2)$ $s \circ (i_2 \times \text {id}) = j_2.$
Now the second equality gives us $s \big\rvert_{Y \times I} = \text {id}_{Y \times I}.$ Whereas the first equality gives us $s \big\rvert_{i_1(B) \times \{0\}} = \text {id}_{i_1(B) \times \{0\}}.$ Instead we need $s \big \rvert_{X \times \{0\}} = \text {id}_{X \times \{0\}}$ because we are willing to show that $s$ is a retraction.
I got stuck at this stage. If $i_1$ is a surjection then we are through.If not, I don't know how to proceed further. Would anybody kindly help me in this regard? A small hint will be warmly appreciated at this stage.
Thanks for your time.