The homotopy class of a path in I x I? I am beginning study in algebraic topology and came across this problem, which is rather upsetting to me. My understanding is that elements of the fundamental group are loops, so how is this dashed path defined? If it is meant to represent the loop from the initial point that then travels across the dashed path and then along the sides, then why is it not the identity? The square itself is just a polygon and I thought its fundamental group would be trivial because every loop at any base point is homotopic to the trivial loop.

 A: The space is not the square $I \times I$; it is a quotient of $I \times I$. The edges are identified as indicated by the arrows. Think of it as gluing each edge to the others in such a way that the arrows go in the same direction. In particular, all corners of the original square are the same point in the quotient space, so that the dashed line is indeed a loop.
A: Van Kampen would be the easiest way to go. Take $U$ and $V$ as in the picture below . $U\cap V$ is the blue part.

Then $U$ is contractible and $V$ deformation retracts onto the boundary which is homotopic to the wedge of a single circle . That is you have just one $0$-cell and a single $1$-cell attached to it by the constant map. Then $\pi_{1}(V)=\langle a\rangle\cong\Bbb{Z}$ and $\pi_{1}(U)=\{e\}$ .
As $U\cap V$ is path connected (annulus) and it deformation retracts to a circle we can take the amalgamated product over $\pi_{1}(U\cap V)$ to get the relation $a^{4}=e$.
Thus $\pi_{1}(X)=\langle a\,; a^{4}=e\rangle \cong \frac{\Bbb{Z}}{4\Bbb{Z}}$ .
Now $\gamma$ can be easily seen to be homotopic to $a*a=a^{2}$ (push $\gamma$ to the left and top edge) which is non trivial. Explicitly , what you do is take the point $(0,0)$ and $(1,1)$ and you have $a*a$(viewed as the left edge and top edge) is a path joining these two points. You use the interior of this convex square set and use a convex homotopy from the diagonal to the path . That is if $\Gamma$ denotes the diagonal line joining $(0,0)$ and $(1,1)$ then you define $H(s,t)=\Gamma(s)+t((a*a)(s)-\Gamma(s))$ . And then you compose with the quotient map $q$ to get the required homotopy which makes $\gamma=q(\Gamma)\sim a*a $
And hence $[\gamma]=[a^{2}]$ and you have $[\gamma^{2}]=[a^{4}]=e$
