TITLE: Nullhomotopic map extended
QUESTION [6 upvotes]: I have troubles understanding this proof:
Let $h:S^1 \rightarrow X$ be a continuous map, then we have that if $h$ is nullhomotopic, $h$ can be extended to a continuous map $k:B^2 \rightarrow X.$
Proof: Since $h$ is nullhomotopic, there exists a homotopy $H: S^1 \times I  \rightarrow X$ between $h$ and a constant map.(This is clear). 
Now we define a map $\pi:S^1 \times I \rightarrow B^2$ by $\pi(x,t)= (1-t)x$.
Then $\pi$ is continuous, onto and closed. Now, I am not sure why we know that this map is closed.  Alright so far. Now we notice that this is a quotient map with $\pi(S^1 ,1)=0 \in B^2$ and otherwise this map is injective. It is concluded from this that we can extend $h$ to a map $k$, but it is not sad: HOW?! Does anybody know why this is possible now?

REPLY [5 votes]: I'll use two lemmas:
Lemma 1: (Theorem 22.2 in Munkres) Let $p : X \to Y$ be a quotient map. Let $Z$ be a space and let $g : X \to Z$ be a map that is constant on each set $p^{-1}(\{y\})$, for $y \in Y$. Then $g$ induces a map $f : Y \to Z$ such that $f \circ p = g$. The induced map $f$ is continuous if and only if $g$ is continuous; $f$ is a quotient map if and only if $g$ is a quotient map.
Lemma 2: (Variation of Theorem 26.6 in Munkres) Let $f : X \to Y$ be a surjective continuous function. If $X$ is compact and $Y$ is Hausdorff, then $f$ is a closed map.
Theorem: Let $h : S^1 \to X$ be a continuous map. If $h$ is nullhomotopic, then $h$ extends to a continuous map $k : B^2 \to X$.
Proof: Since $h$ is nullhomotopic, there exists a homotopy $H : S^1 \times I \to X$ (which is continuous) between $h$ and $e_{c_0}$ for some $c_0 \in X$ such that $$\begin{align*} H(s, 0) &= h(s) \\ H(s, 1) &= e_{c_0}(s) = c_0\end{align*}.$$ Define $\pi : S^1 \times I \to B^2$ by $\pi(s, t) = (1 - t)s$. Notice:

$\pi$ is continuous since the product of two continuous functions is continuous.
$\pi$ is surjective since we are essentially shrinking the circle $S^1$ continuously towards the center $\textbf 0 \in \mathbb R^2$ and the mapping will hit every element in between $S^1$ and $0$, i.e., every point in $B^2$.
$\pi$ is closed since $S^1 \times I$ is compact and $B^2$ is Hausdorff and we use Lemma 2.

Conclude that $\pi$ is a quotient map.
Notice that $H$ is constant on $\pi^{-1}(\{y\})$ for $y \in Y$.

If $y \neq \textbf 0$, then $\pi^{-1}(\{y\})$ consists of a single element, so the property holds trivially.
If $y = \textbf 0$, then $\pi^{-1}(\{y\}) = S^1 \times \{1\}$, but $H(s, 1) = e_{c_0}(s) = c_0$ and is therefore constant.

By Lemma 1, $H$ induces $k : B^2 \to X$ (continuous since $H$ is continuous, again by Lemma 1) such that $H = k \circ \pi$ and in particular $$\begin{align*} H(s, 0) &= k(s) = h(s) \\h(s, 1) &= k(0) = c_0\end{align*}.$$