Let $f \colon(X,x_0)\to (Y,y_0)$ and $g \colon(S^n,s_0)\to (X,x_0)$ be base point preserving maps. Let $Z$ be the space that arises from $X$ by attaching an $(n+1)$-disk via $g$.
I want to prove that $f_*[g]=0 \in \pi_n(Y,y_0)$ implies that $f$ extends to a map $Z\to Y$.
My attempt: $f_*[g]=0$ implies there is a homotopy $$H \colon S^n\times[0,1]\to Y$$ from $f\circ g$ to the constant map. Therefore $H$ induces a homotopy $$\tilde H \colon S^n\times[0,1]/S^n\times\{1\}\to Y$$ for which we have $\tilde H(\cdot,0) = f\circ g$.
Now, here is where I am kind of stuck. I figured out that by using the universal property of the pushout, I get the following diagram
If this is correct, I could conclude that by the universal property the dashed arrow is the desired extension of $f$.
Now my issue is, that I didnt know about pushouts in the first place and stumbled upon them after I was having difficulties understanding the geometric explanation of the given solution.
The solution followed af first the same direction I was taking but then says:
On the boundary $S^n\subset D^{n+1}$ (which corresponds to the height $0$ part of $S^n\times[0,1]/(S^{n}\times\{1\})$ the map $H$ is precisely $f\circ g$ (if the identification with $D^{n+1}$ is chosen appropriately). Thus the map $X\sqcup D^{n+1}\to Y$ which is $f$ on the first component and $\tilde H$ on the second, induces a map $Z\to Y$ which extends $f$.
Okay, I already know that $\tilde H(\cdot, 0) = f\circ g$. But (without having the pushout property in mind), how can I conclude everything that follows from there? Is there a geometrical intuition I am missing? Or is the solution implicitely using the universal property of the pushout either?
(I am kind of assuming that's the case since I don't see how else we would induce the extension of $f$ "naturally").
Thanks for any help!
