A cofibration induces a cofibration
Solution 1:
You know what a pushout is, and that $X \stackrel{f^*}{\rightarrow} X \cup_f Y \stackrel{j}{\leftarrow}Y$ is a pushout of $X \hookleftarrow A \stackrel{f}{\rightarrow} Y$. Note that I avoided to consider $Y$ as a genuine subspace of $X \cup_f Y$. Of course $j$ is an embedding, but we do not need a separate proof since we shall show that it is a cofibration, and all cofibrations are known to be embeddings.
Let us more generally start with any cofibration $i : A \to X$.
Let $X \stackrel{f^*}{\rightarrow} Z \stackrel{j}{\leftarrow} Y$ be the pushout of $X \stackrel{i}{\leftarrow} A \stackrel{f}{\rightarrow} Y$. Here are some extended hints what you have to do.
1) Show that $X \times I \stackrel{f^* \times id_I}{\rightarrow} Z \times I \stackrel{j \times id_I}{\leftarrow} Y \times I$ is the pushout of $X \times I \stackrel{i \times id_I}{\leftarrow} A \times I \stackrel{f \times id_I}{\rightarrow} Y \times I$. You will need the exponential law for function spaces endowed with the compact-open topology. This allows to identify any continuous map $u : V \times I \to W$ with the continuous map $u^* : V \to W^I, u^*(v)(t) = u(v,t)$.
2) Given a map $\phi : Z \to W$ and a homotopy $h : Y \times I \to W$ such that $h_0 = \phi j$, we have to find a homotopy $H : Z \times I \to W$ such that $H_0 = \phi$ and $H (j \times id_I) = h$.
Consider the map $\psi = \phi f^* : X \to W$ and the homotopy $k = h (f \times id_I) : A \times I \to W$. We have $k_0 = h_0 f = \phi j f = \phi f^* i = \psi i$ and use the fact that $i$ is a cofibration to find a homotopy $K : X \times I \to W$ such $K_0 = \psi$ and $K (i \times id_I) = k$. Therefore $h (f \times id_I) = K (i \times id_I)$ and we use 1) to find $H : Z \times I \to W$ such that $H (f^* \times id_I) = K$ and $H (j \times id_i) = h$. Now check that $H$ satisfies $H_0 = \phi$. To do so, use the universal property of the pushout diagram based on $X \stackrel{i}{\leftarrow} A \stackrel{f}{\rightarrow} Y$: We have $\psi i = \phi f^* i = \phi j f$, hence there exists a unique $\chi : Z \to W$ such that $\chi f^* = \psi$ and $\chi j = \phi j$. But both $H_0, \phi$ have this property.