I'm just learning about CW complexes. I came across this answer: "One way of constructing a connected $2$-dimensional CW complex with fundamental group $\Bbb Z/n$ (for some integer $n\geq 2)$ is to start with the circle $S^1$, and to attach a $2$-cell $D^2$ with the attaching map $\partial D^2\to S^1, z\mapsto z^n$."
When I imagine a circle and a disc attached to it by wrapping it 2 times around, I have two discs attached together so I'd imagine it'd be homeomorphic to a sphere. But according to the answer I quoted I should get fundamental group $\Bbb Z/2$. What am I missing?
Let $X=S^1 \cup_{z \sim z^n} D^2$ be the $2$-dim CW complex: Our space looks like the upper hemisphere with the equator wrapped $n$ times around itself.
Mapping a homotopy class of loops $[\omega]: I \rightarrow X$, we can just count how often they are wrapped around the equator $S^1$. This path can be wrapped once, twice etc. according to the winding number of the map $\partial D \rightarrow S^1 $ and clearly wrapping it $n$ times creates the actual boundary of $X$ (the $n$ wrap), which we can contract to e.g. the North Pole $N$.
Therefore we get $n[w]= const_N$ which is the neutral element of $\pi_1$, so $\pi_1(X)\cong \mathbb{Z}_n$.
For $n=2$ you get in fact the real projective space $\mathbb{RP}^2$, which is constructed via the quotient space of group-action of the antipodal map on the sphere $\mathbb{S}^2$. You might also look here.