Can we always view loops as maps from $S^1\to X$? I am working on exercises from Hatcher, algebraic topology and in a certain exercise (1.1.5), we identify a loop, which is a path $\gamma:I\to X$ with a map $f:S^1\to X$, which we can do since $\gamma(0)=\gamma(1)$ and project to the quotient which is homeomorphic to $S^1$. 
Now, suppose every map $f:S^1\to X$ extends to a map $D^2\to X$. I can show that a map fron $S^1\to X$ is then homotopic to a  constant map $S^1\to X$, how can I justify that this implies that every loop is homotopic to a constant loop,
I.e. $\pi_1(X,x_0)=0?$
 A: Let $p : I \to S^1$ denote the quotient map with $p(0) = p(1) = 1 \in S^1 \subset \mathbb{C}$ (you may take $p(t) = e^{2\pi i t}$). Given a loop $\gamma : I \to X$ at $x_0$,  let $\gamma^* : S^1 \to X$ denote the induced map characterized by $\gamma^* \circ p = \gamma$. Let $\phi : D^2 \to X$ be an extension of $\gamma^*$.
Now $q : S^1 \times I \to D^2 \subset \mathbb{C}, q(z,t) = (1-t)z +t$ is a well-defined (note $\lvert q(z,t) \rvert \le 1$) continuous map. We have $q(z,0) = z$, $q(z,1) = 1$ for all $z$ and $q(1,t) = 1$ for all $t$.
Then $$h : I \times I \to X, h = \phi \circ q \circ (p \times id_I)$$
is a homotopy with the properties
1) $h(x,0) = \phi(q(p(x),0)) = \phi(p(x)) = \gamma^*(p(x)) = \gamma(x)$
2) $h(x,1) = \phi(q(p(x),1)) = \phi(1) = \gamma^*(1) = x_0$
3) $h(i,t) = \phi(q(p(i),t)) = \phi(q(1,t)) = \phi(1)= \gamma^*(1) = x_0$ (where $i = 0,1$)
This shows that the loop $\gamma$ is homotopic to the constant loop at $x_0$.
Edited on request:
The following are equivalent:
(1) $\gamma$ is homotopic to the constant loop.
(2) $\gamma^*$ is homotopic to the constant map $c_{x_0} : S^1 \to X, c_{x_0}(z) \equiv x_0$, via a homotopoy $h^* : S^1 \times I \to X$ such that $h^*(1,t) = x_0$ for all $t$ (i.e. via a basepoint-preserving homotopy).
(3) $\gamma^*$ is homotopic to a constant map $c_{x} : S^1 \to X$ for some $x \in X$.
(4) $\gamma^*$ has an extension to $D^2$.
We have already shown $(4) \Rightarrow (1)$.
$(1) \Rightarrow (2)$: Let $h : I \times I \to X$ be homotopy of paths from $\gamma$ to the constant path at $x_0$. The map $p \times id_I : I \times I \to S^1 \times I$ is a quotient map because the factor $I$ is locally compact. Hence $h$ induces a map $h^* : S^1 \times I \to X$ such that $h^* \circ (p \times id_I) = h$. This is the desired basepoint-preserving homotopy.
$(2) \Rightarrow (3)$: Nothing to show.
$(3) \Rightarrow (4)$: Let $H : S^1 \times I \to X$ be a homotopy from  $\gamma^*$ to a constant map $c_{x}$. The map
$$r : S^1 \times I \to D^2, r(z,t) = (1-t)z$$
is a continuous surjection. Since $S^1 \times I$ and $D^2$ are compact Hausdorff, $r$ is a closed map and therefore a quotient map. Define
$$\phi : D^2 \to X, \phi(z) =
\begin{cases}
H(\frac{z}{\lvert z \rvert },1 - \lvert z \rvert)  & z \ne 0 \\
x & z = 0
\end{cases}
$$
Obviously $\phi(z) = H(z,0) =  \gamma^*(z)$ for $z \in S^1$ and $\phi \circ r = H$ since for $z \in S^1$ we have $\lvert (1-t)z \rvert = 1-t$ and therefore
$$\phi(r(z,t)) =\begin{cases}
H(\frac{(1-t)z}{\lvert (1-t)z \rvert },1 - \lvert (1-t)z \rvert) =  H(z,t) & t < 1 \\
\phi(0) = x = H(z,1)  & t = 1
\end{cases}
$$
But now $\phi \circ r = H$ implies that $\phi$ is continuous and we are done.
A: It is known that given a function $h:X\to Y$ which is continuous and $h(x_0)=y_0$ we can define a function $h_*:\pi_1(X,x_0)\to\pi_1(Y,y_0)$ given by $h_*([\sigma])=[h\circ\sigma]$. Then $h_*$ is well defined and it is a group homomorphism.
Now to the exercise itself. Take $\gamma:I\to X$ to be a loop around $x_0$. We can define $p:I\to D^2$ by $p(t)=e^{2\pi it}$ and $f:S^1\to X$ by $f(e^{2\pi it})=\gamma(t)$. Then $f$ is well defined because $\gamma(0)=\gamma(1)$ and it is also continuous. Hence it can be extended to $F:D^2\to X$ which is also continuous. And now note that $\gamma=F\circ p$. Hence:
$[\gamma]=[F\circ p]=F_*([p])=[e_{x_0}]$
We use the fact that $D^2$ is simply connected so $[p]$ is the identity element of $\pi_1(D^2)$. As $F_*$ is a homomorphism it sends identity to identity. So we got $\gamma$ is homotopic to the constant loop $e_{x_0}$ as it belongs to the same equivalence class. 
