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?