Fibration induces set bijection on homotopy classes of maps of pairs I am working on exercise 2.F.4 in Spanier's Algebraic Topology. Let $f \colon E \rightarrow B$ be a fibration (i.e. has the homotopy lifting property with respect to all spaces) and let $b_0 \in p(E)$, $F = p^{-1}(b_0)$. Let $X$ be any space, viewed as a subspace of its cone $CX$. I want to show that
$$
p_\# \colon [(CX,X) ; (E,F)] \rightarrow [(CX,X); (B,b_0)], [f] \mapsto [p \circ f]
$$
is a bijection. Here, $[(A,B); (C,D)]$ denotes the set of homotopy classes of maps of pairs $(A,B) \rightarrow (C,D)$, wherethe homotopies are also maps of pairs at each time.
My idea is to construct an inverse map: let $f \colon CX \rightarrow B$ be a map, then there is a map $f' = f \circ q \colon X \times I \rightarrow B$, where $q$ is the quotient map collapsing $X \times 0$ to a point. Hence, $f'$ can be viewed as a homotopy. Since $f'(X \times 0) = \{b\}$ is a point in $p(E)$, there is some $e \in E$ such that $p(e) = b$. Then, $f'$ can be lifted to a map $g' \colon X \times I \rightarrow E$, such that $p \circ g' = f'$ and $g'(X \times 0) = e$. Therefore, $g'$ factors through $CX$ to give a map $g \colon CX \rightarrow E$. Note that all the maps are actually maps of the appropriate pairs.
Now, $p \circ g = f$, so the assignment $[f] \rightarrow [g]$ defines a right inverse for $p_\#$. However, I do not know how to show that the assignment is well-defined (i.e. independent of the choice of $f$ within its homotopy class) and that it is a left inverse as well.
 A: $\require{AMScd}$
$\def\diaguparrow#1{\smash{
  \raise.8em\rlap{\scriptstyle #1}
  \lower.3em{\mathord{\diagup}}
  \raise.52em{\!\mathord{\nearrow}}
}}$
One important trick in homotopy theory is to notice that a cup deformation retracts on its bottom. This enables one to control the way homotopies lift, because lifting from the bottom is alternatively lifting from the bottom and the sides.
For example, a lifting
$\begin{CD}
I @>>> E \\
@VVV \diaguparrow{}@VVV \\
I \times I @>>> B
\end{CD}$ is just a lifting of a homotopy of a path. However, by the observation above one alternatively has lifting in
$\begin{CD}
I \times \{0\} \cup \{0\} \times I \cup \{1\} \times I @>>> E \\
@VVV @VVV \\
I \times I @>>> B,
\end{CD}$
so one can specify the boundaries of paths that constitute the lifted homotopy.
Let $H: CX \times I \to B$ be a homotopy between $f_i: CX \to B, i = 1,2.$ This gives a map of the "cube" $H: X \times I \times I \to B.$ On its top and its bottom $H$ is constant, and on its sides it is $f_i$. Now notice that three sides of a cube is homotopically the same thing as one of its sides, and extending homotopy from one of its sides is exactly what homotopy lifting property is about. Thus, we can fix the liftings on three sides and lift $H$:
$\begin{CD}
X \times I \times \{0\} \cup X \times I \times \{1\} \cup X \times \{1\} \times I @>{g_1, g_2, \gamma}>> E \\
@VVV \diaguparrow{\bar{H}}@VVV \\
X \times I \times I @>{H}>> B.
\end{CD}$
Here $\gamma: X \times \{1\} \times I \to I \to E$ comes from some path connecting values of $g_0$ and $g_1$ on the tip of the cone. We have to specify this so that $\bar{H}$ will be indeed a homotopy between maps from $CX$ (not just $X \times I$).
Each slice $X \times I \times \{t\} \to E$ of the lift will then map the upper side of the square to a point and the lower side to $F$ (because its projection falls in $b_0$). Moreover, $X \times I \times \{0\} \to E$ and $X \times I \times \{1\} \to E$ are $g_0$ and $g_1$, so $\bar{H}$ witnesses a proper homotopy between $g_i.$
Now, if you start with a map from $[(CX,X) ; (E,F)],$ you already have it as a lifting for its projection. Any other lift will be homotopic to it (for similar reasons), so the assignment constructed is a left inverse to $p_{\#}$ as well.
