Commutative ring $R$ of odd prime characteristic $p$ and $(a+b)^n=a^n+ b^n, \forall a,b \in R$ Let $R$ be a commutative ring with unity , of prime characteristic $p$. If $n>1$ is an integer such that $(a+b)^n=a^n+ b^n, \forall a,b \in R$ i.e. the map $f : R \to R$ , given by $f(a)=a^n, \forall a\in R$ is a ring homomorphism , then is it true that $n$ is a power of $p$ ?
Considering the copy of $\mathbb F_p$ that embeds in $R$, since $r^n=r, \forall r \in \mathbb F_p$, so $ p-1 |n-1$. But I am unable to conclude anything else.
The comment of Georges shows that the claim is not true for $p=2$. But what about for odd $p$ ?
Please help. 

Consolidating the examples from the comments given by Georges Elencwajg and Max . . .

Let $p$ be a prime, and let $n$ be a positive integer. 

Claims:

$\;\;\;\;(1)\;\;\;x^n = x$ for all $x\in F_p$ if and only if $(p-1){\,\mid\,}(n-1)$.

$\;\;\;\;(2)\;\;\;(a+b)^n = a^n + b^n$ for all $a,b\in F_p$ if and only if $(p-1){\,\mid\,}(n-1)$.

In particular, from claim $(2)$, it follows that the identity $(a+b)^n = a^n + b^n$ does not force $n$ to be a power of $p$.

Proof of claim $(1)$:

First suppose $(p-1){\,\mid\,}(n-1)$.

Then we can write $n-1 = k(p-1)$, for some positive integer $k$.

Let $x\in F_p$.

If $x=0$, then $x^n = 0$, so $x^n = x$.

If $x \ne 0$, then $x^{p-1}=1$, hence
\begin{align*}
x^n
&= x^{n-1}x\\[4pt]
&=x^{k(p-1)}x\\[4pt]
&= \left(x^{p-1}\right)^kx\\[4pt]
&=(1)^kx\\[4pt]
&=x\\[4pt]
\end{align*}
Conversely, suppose $x^n = x$ for all $x\in F_p$.

Then $x^{n-1}=1$, for $x \in (F_p)^*$.

But the multiplicative group $(F_p)^*$ is cyclic of order $p-1$.

If $a$ is a cyclic generator of $(F_p)^*$, then since the order of $a$ is $p-1$, and $a^{n-1}=1$, it follows that $(p-1){\,\mid\,}(n-1)$.

This completes the proof of claim $(1)$.

Proof of claim $(2)$:

First suppose $(p-1){\,\mid\,}(n-1)$,

By claim $(1)$, we have $x^n=x$ for all $x\in F_p$, hence $(a+b)^n = a + b = a^n + b^n$.

Conversely, suppose $(a+b)^n = a^n + b^n$ for all  $a,b\in F_p$.

It follows that for any positive integer $k$, the equality
$$(x_1 + \cdots + x_k)^n = x_1^n + \cdots + x_k^n$$
holds for all $x_1,...,x_k\in F_p$.

Letting $x_1 = \cdots = x_k = 1$, we get the identity $k^n = k$, where $k$ is now interpreted as an element of $F_p$.

It follows that $x^n = x$ for all $x\in F_p$, hence by claim $(1)$, we get $(p-1){\,\mid\,}(n-1)$.

This completes the proof of claim $(2)$.
