Let $R$ be a ring (assumed to be commutative and with unit). What is the center of the category of $R$-algebras, i.e. $\text{Z}(R\text{-Alg})$? This is a commutative monoid. See [this](https://mathoverflow.net/questions/61195/functoriality-of-the-center-of-a-category) recent question for the definition of the center. Actually it is easy to reformulate this using the free $R$-algebra on one generator, which classifies elements in $R$-algebras:


$\text{Z}(R\text{-Alg})$ consists of the polynomials $p \in R[t]$ such that $p(0)=0, p(1)=1$ and in $R[t\_1,t\_2]$ we have $p(t\_1 + t\_2) = p(t\_1) + p(t\_2)$ and $p(t\_1 \* t\_2) = p(t\_1) \* p(t\_2)$. The commutative monoid structure on the center corresponds to $(p\_1,p\_2) \mapsto p\_1(p\_2)$. You can also view the center as the endomorphism monoid of the *bi*algebra $R[t]$.


If we write $p = a\_n t^n + ... + a\_1 t$ with $a\_n \neq 0$, then from $p(t\_1 t\_2) = p(t\_1) p(t\_2)$ we get that $a\_n$ annihilates every $a\_i$ with i < n and that every $a\_i$ is idempotent. Thus if $R$ has only trivial idempotents, it follows $p = t^n$ and we have to ask when $(t\_1 + t\_2)^n = t\_1^n + t\_2^n$ in order to restrict $n$. Besides, even if $R$ has idempotents, $p(t\_1 + t\_2) = p(t\_1) + p(t\_2)$ implies that $(t\_1 + t\_2)^n = t\_1^n + t\_2^n$. For $R = \mathbb{Z}$, it is easy to see $n=1$ and thus the center is trivial. For $R = \mathbb{F}\_p$, it is easy to see that $n$ is a power of $p$, so that the center is $\cong \mathbb{N}$, generated by the Frobenius. This means that the Frobenius is the universal endomorphism of the rings of characteristic $p$. But what about other rings $R$?



Center of the category of $R$-algebras
It's a standard lemma that the gcd of the binomial coefficients $(k,n-k)$ (for $0\lt k\lt n$) is $p$ when $n=p^r$ for some $r>0$ (with $p$ prime) and $1$ in all other cases. It follows that for any $f(t)\in R[t]$ with properties as described, there is a finite splitting $R=\prod\_{i=1}^mR\_i$, where for each $i$ either


(a) $f(t)$ maps to $t$ in $R\_i[t]$; or


(b) Some prime $p$ is zero in $R\_i$, and $f(t)$ maps to $t^{p^{r\_i}}$ in $R\_i[t]$ for some $r\_i>0$.


Thus, the general case is not very different from the ones you mentioned already. These ideas crop up in the study of formal group laws and the dual Steenrod algebra, so they are fairly well known among algebraic topologists.


UPDATE: as darij says, for the centre of $R$-Alg we should additionally insist that $f(at)=a f(t)$ for all $a\in R$, or equivalently that $a^{p^{r\_i}}=a$ for all $a\in R\_i$. In the case where $r\_i=1$ and $p=2$ this means that $R\_i$ is a Boolean algebra, so by the Stone representation theorem it is the ring of continuous functions from $X\_i$ to $\mathbb{Z}/p$ for some Stone space $X\_i$. I think this also holds for $p>2$. If $r\_i>1$ then we can still pick a field $F$ of order $p^{r\_i}$, whose Galois group $G$ over $\mathbb{Z}/p$ will be cyclic of order $r\_i$. If $X\_i$ is a Stone space with an action of $G$, then the ring of continuous $G$-equivariant maps from $X\_i$ to $F$ will have the properties required for $R\_i$. I think that every possible $R\_i$ arises in this way.


