TITLE: Loop is contractible iff it extends to a map of disk
QUESTION [5 upvotes]: Let $X$ be a space, $f : S^1 \to X$ be continuous function. $f$ is homotopic to constant map $h = c$ iff $\exists$ continuous $g: D^2 \to X $ such that $g |_{S^1} = f $
My Attempt
Take a homotopy $F: S^1 \times I \to X $ from constant map $c$ tot $f$. LEt $g : D^2 \to X$ be given such that $g(xs) = F(x,s)$. $g$ is obviously cotinuous by definition and hence $g(x) = F(x,1) = f(x) $. Since this maps holds for every $x \in S^1$, then we have $f(x) = g|_{S^1}$. Now we check that $D^2 \cong S^1 \times I $ (I am kind of stuck in this part, help would be appreciated)
Conversely, Take $g : D^2 \to X $ such that $f(x) = g|_{S^1} $. Let $h : S^1 \to \{x_0 \} \subseteq X$ be constant map $h = c$. Then $F(x,s) = sc + (1-s)f $ provides a homotopy between $f$ and $h = c$
I would really appreciate a feedback, thank you very much for your time.

REPLY [4 votes]: Your intuition is correct, but the proof needs to be more rigorous.
For the first part, you have to construct $g:D^2\rightarrow X$ by hand. I don't understand why you say that $g$ is given. What is given though, as you say, is the homotopy $F:S^1\times I \rightarrow X$ from the constant path $c$ to $f$. Define $g:D^2\rightarrow X$ by the following formula : 

$g(x)$ is the based point if $\Vert x\Vert \leq 1/2$,
$g(x)=F(\frac{x}{\Vert x\Vert}, 2-2\Vert x\Vert)$ if $\Vert x \Vert \geq 1/2$.

For the second part, you probably forgot to put $g$ in your definition of $F$. You probably meant $F(x,s)=g(ss_0+ (1-s)x)$, where $s_0$ is the basepoint of $S^1$.