For a pointed space (X,p), the nth homotopy group
πn(X,p) is usually defined as the group of maps of the
n-sphere which take (1,0,...,0) to p, modulo
homotopy-rel-basepoint. What's potentially weird is that
S0 is disconnected, whereas Sn is connected
for n>0. But then π0(X) just counts the number of
path components of X. Of course, it doesn't have a group structure
because S0 isn't a cube with its boundary identified;
this is anomalous.
On the other hand, this corresponds perfectly with the other
characterization of homotopy groups I've seen, where
π0(X,p) is defined to be the set of path
components of X, and then πn(X,p) is inductively defined
as the "loop space" of πn-1(X,p), i.e. the group of
homotopy classes of loops starting and ending at the basepoint (rel
basepoint, of course), with composition defined simply as
composition of loops.
So, while in neither setup is π0(X,p) a group, I
think this is as well-defined as it's going to get. As far as I
know, only in the setting of Lie groups is there a natural way to
put a group structure on the path components (just take
G/G0, where G is the Lie group and G0 is the
path component of the identity).