This is Exercise II.5.8 from Mac Lane, Categories for the Working Mathematician.
For the identity functor $I_C$ of any category, the natural transformations $\alpha:I_C\dot{\to}I_C$ form a commutative monoid. Find this monoid in the cases $C=\mathbf{Grp}$, $\mathbf{Ab}$ and $\mathbf{Set}$.
I found out that this monoid is called the center of the category $C$, and I'm going to call is $Z(C)$. My problem was to find a nice characterization of the centers of $\mathbf{Grp}$ and $\mathbf{Ab}$. Here's my work so far:
Notice that $\alpha:I_C\dot{\to} I_C$ is natural iff $\alpha_c$ commutes with every arrows $f:c\to c$ for every $c$ (in other words, iff $\alpha_c$ is in the center of the monoid $\hom_C(c,c)$). In symbols: $$Z(C)=\left\{\alpha:I_C\dot{\to}I_C \mid \forall c\in C, \forall f\in\hom_C(c,c), \alpha_c f=f\alpha_c\right\}\qquad (*)$$ This implies directly that the center of $\mathbf{Set}$ is trivial (that is, it contains only the unit natural transformation).
However, this will not work in $\mathbf{Grp}$ and $\mathbf{Ab}$, since the monoid of endomorphisms of $\mathbb{Z}$ is commutative. However, not every two endomorphisms of arbitrary groups commute: Let $G=F_2$, the free group with two generators $a$ and $b$. Let $f,g:F_2\to F_2$ be morphisms such that $f(a)=f(b)=ab$, $g(a)=g(b)=a$. Then $fg(a)=f(a)=ab$, and $gf(a)=g(ab)=a^2$.
That said, the best description of $Z(C)$, for $C=\mathbf{Grp}$ or $\mathbf{Ab}$, I can give at the moment is ($*$) as above. What would be better descriptions of $Z(\mathbf{Grp})$ and $Z(\mathbf{Ab})$?
PS: Since I'm self-studying, I wouldn't tag this question as "homework".