Show that $\pi_1(X,x_0)\cong 0$ if and only if for any loop $f:[0,1]\rightarrow X$, $f(0)=f(1)=x_0$, there exists a continuous map $g:[0,1]\times[0,1]\rightarrow X$, such that $g(0,s)=f(\frac{s}{2})$, $g(1,s)=f(1-\frac{s}{2})$, $g(t,0)=x_0$, $g(t,1)=f(\frac{1}{2})$.
Is there any hint for this question?
Also, I was taking an algebraic topology and I am struggling with this subject (I can understand the text, but I can't solve any of the questions, and the question usually do not have answers, which makes my study even harder) Is there any way to remedy this problem?