I'm going through Spanier and got stuck on the following problem:
Show that a space $Y$ is contractible if and only if given a pair $(X,A)$ having the homotopy extension property with respect to $Y$, any map $f:A\rightarrow Y$ can be extended over $X$.
The forward direction is pretty easy, but I'm having some trouble with the converse.
I was thinking about trying the contrapositive:
Suppose $Y$ is not contractible. Then there exists a map $f:Y\rightarrow Y$ that is not null-homotopic. Since the mapping cylinder $(M_f,Y)$ has the homotopy extension property maybe I could arrive at a contradiction if $f$ extends to $M_f$?
Thanks in advance!