TITLE: Functorial morphisms on the identity functor
QUESTION [5 upvotes]: Given a category $\mathcal{C}$, the functorial morphisms $\phi:\rm{id}_{\mathcal{C}}\rightarrow \rm{id}_{\mathcal{C}}$ define a monoid via $(\phi\circ \psi)_X := \phi_X\circ\psi_X$ for $X\in \rm{Ob}(\mathcal{C})$, where the unit is $\rm{id}_{\rm{id}_\mathcal{C}}:\rm{id}_{\mathcal{C}}\rightarrow \rm{id}_{\mathcal{C}}$, $ (\rm{id}_{\rm{id}_\mathcal{C}})_X := \rm{id}_X$.
The goal is to compute this monoid for the categories $\rm{Set}$, $\rm{Ring}$ and $R-\rm{Mod}$ for a given commutative ring $R$. 
How do I approach this? For $\rm{Set}$, let $\phi$ be such a functorial morphism, $X,Y$ be any two sets. Then there is a commutative diagram such that $f\circ \phi_X = \phi_Y \circ f$ for every map $f:X\rightarrow Y$. I want to conclude some necessary properties of $\phi_X$ from this, but I don't know how yet.

REPLY [4 votes]: Noel Lundström has already given the answer when the identity functor is representable, as is the case in $\newcommand\Set{\mathbf{Set}}\newcommand\Mod{\mathbf{Mod}}\Set$ and $R\text{-}\Mod$. The question still remains of what to do in $\newcommand\Ring{\mathbf{Ring}}\Ring$, since the identity is not representable anymore.
The solution here is partly given by the same idea. Forget down from $\Ring$ to $\Set$. Call the forgetful functor $U$. $U$ is representable, we have $U\cong \Ring(\Bbb{Z}[x],-)$.
Moreover, $U$ is faithful, since a ring homomorphism is determined by what it does to elements of the ring. Suppose then that $\phi :1_\Ring\to 1_\Ring$ is an endomorphism of the identity functor, then applying $U$ we have $U\phi : U\to U$ is an endomorphism of $U$, and moreover $U(\phi\psi) = (U\phi)(U\psi)$, since $U$ is a functor, and finally if $U\phi = U\psi$, then $\phi=\psi$, since $U$ is faithful. Therefore $U$ embeds the monoid of endomorphisms of the identity functor into the monoid of endomorphisms of $U$. 
By the Yoneda lemma, the endomorphisms of $U$ are given by $\Ring(\Bbb{Z}[x],\Bbb{Z}[x])$, which can be identified with the monoid of one variable polynomials under composition of polynomials, i.e. $p*q = p(q(x))$. Note that $x$ is the identity.
Now we're just left with the question of which endomorphisms come from endomorphisms of the identity functor of rings. 
Well, the natural transformation corresponding to the polynomial $p(x)$ is the map of sets $r\mapsto p(r)$ for $r\in R$ an element of any ring $R$. When does this define a ring homomorphism?
Well, let's consider $\Bbb{Z}$. $\Bbb{Z}$ has no nontrivial ring homomorphisms from it to itself, since $1$ generates $\Bbb{Z}$ and $1$ must be fixed by any ring homomorphism. Thus $p(n)=n$ for all integers $n$. But then $p(x)-x$ has infinitely many zeros, so $p(x)=x$. Thus the only endomorphism of $1_\Ring$ is the identity.