When is $\pi_0$ a group?
In general, $\pi_0(X)$ is the set of path components of $X$ and does not have a group structure. After all, $S_0$ is just two points and the usual way of multiplying using the equation of a sphere doesn't work. But sometimes it is. For example, if $X$ is an H space we still have a 0-th homotopy group.
What are other cases? In particular, if $G$ is a discrete group (group with the discrete topology), then is $\pi_0(G)=G$ as a set and as a group?
When $G$ is a topological group, we always have that $\pi_0(G)$ is a (topological) group!
Lemma: The connected component of the identity in $G$ - let's denote it $C$ - is a normal subgroup of $G$. By continuity of the group operation, $f(C,C)$ is connected. It contains the identity, so $f(C,C) \subset C$ because $C$ is the connected component of the identity. Similarly, $C^{-1} \subset C$ by continuity of the inversion operator. So $C$ is a subgroup.
We need to show normality still: that $xCx^{-1} \subset C$ for $x \in G$. Continuity (again!) shows us that $f(xC, x^{-1})$ is connected, because $xC = f(x,C)$ is connected, so that $xCx^{-1} \subset C$. This proves what we wanted to prove.
Now $G/C$ is the set of connected components of $G$, and is a group. So $\pi_0(G)$ always inherits a group structure from $G$.