A cofibration induces a cofibration Let $X, Y$ be topological spaces, $A\subseteq X$ and $f:A\to Y$ a (continuous) map.  Denote $X\cup_f Y=(X\sqcup Y)/\sim,$ where $\sim$ is an equivalence relation generated by $a\sim f(a).$

Let $A\hookrightarrow X$ be a cofibration and consider a map $f: A\to Y.$ Show that $Y\hookrightarrow X\cup_f Y$ is also a cofibration.

I think it is easy, but I'm missing something. Firstly, I tried to prove it from the definition, so I draw some diagrams, but I failed to lift $A\hookrightarrow X$ to $Y\hookrightarrow X\cup_f Y$ using $f$. Then I tried to use the theorem which says $(X, A)$ has homotopy extension property iff $X\times\{0\}\cup A\times I$ is a retract of $X\times I$, but unfortunately, I tried to fit it on wrong spaces. Eventually, I tried to define a retraction $R: (X\cup_f Y)\times I\to(X\cup_f Y)\times\{0\}\cup Y\times I$ using the retraction $r: X\times I\to X\times\{0\}\cup A\times I$ and a (continuous) map $F:X\to Y$ such that $F|_A=f$, but once again I failed to manage it.


*

*Please, give just a hint (if possible).

*Is $Y$ in fact a subspace of $X\cup_f Y$? [Edit: the question is answered here apparently.]

*If I have a continuous map $f: A\to Y, A\subseteq X$, can I extend it in general to a continuous $F: X\to Y, F|_A=f$?

 A: 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.
