I've been told that the category of groups isn't a subcategory of Set. How come?
Wikipedia:
Let C be a category. A subcategory S of C is given by
a subcollection of objects of C, denoted ob(S), a subcollection of morphisms of C, denoted hom(S), such that:
- for every $X$ in ob(S), the identity morphism $id_X\in$ hom(S)
- for every morphism $f : X \to Y$ in hom(S), both the source $X$ and the target $Y$ are in ob(S) for every pair of morphisms $f,g\in$ hom(S) $fg\in$ hom(S) whenever it is defined
Perhaps it's inadequate to consider ob(Grp) as a subcollection of ob(Set)?
In a comment Tobias Kildetoft indicated a condition about non uniqueness: any given set can have more than one group structure, but that condition does not appear to be included in the definition above.
My conclusion from the answer and the comments is that Grp formally is a subcategory of Set but that category theorist don't want to consider it as a subcategory because that is afflicted with a bad intuition.
OK, I realize that Grp isn't a subcategory of Set in the way I thought. The classical picture of a group as a set is not adequate enough for category theory. The equivalent category of set compositions, however, is a subcategory of Set.
This definition of subcategory is very poorly behaved; in particular, it's not invariant under equivalence of categories. That is, it's possible to have three categories $S, C, D$ such that
The well-behaved notion of subcategory is that of full subcategory, for which the above doesn't happen. It's straightforward to prove that $\text{Grp}$ is not equivalent to a full subcategory of $\text{Set}$ (also exercise).
There is a natural forgetful functor $\text{Grp} \to \text{Set}$, but it is not full.
It is possible to exhibit a category equivalent to $\text{Set}$ in which $\text{Grp}$ is a (non-full) subcategory. Namely, take the category whose objects are groups but whose morphisms are arbitrary functions on underlying sets, not respecting the group structure. This category is equivalent to $\text{Set}$ (exercise; you need to know that every set admits at least one group structure). It has a subcategory with the same objects but whose morphisms do respect the group structure, which is of course just $\text{Grp}$. But no category theorist would describe this situation as "$\text{Grp}$ is a subcategory of $\text{Set}$."