Suppose $(a+i)^{a+i}\equiv a^a \mod p$ for all $a=1,2,\dots$ Then $i$ is divisible by $p(p-1)$.
Solution:
Take $a=p$ then we see that $(i+p)^{p+i}\equiv p^p \equiv 0 \mod p$
Since $i+p\equiv 0 \mod p$ (why is that?) this means that $i^i i^p=0$ and thus that if $i$ is nonzero, then $i^i = 0$ which means that $p$ divides $i^i$ and thus $p$ divides $i$.
Even if $i=0$, $p$ still divides $i$.
Now the equation is $(a+pk)^{a+pk}=a^a$ (again I don't know why). This is the same as $(a)^{a+pk}=a^a$ (I assumed this is because other p terms will cancel out mod p) which implies that $a^k=1$. Since this is true for all $a$ and $\mathbb F_p$ has a primitive root, we can conclude that $p-1$ divides $k$ and hence $i$.
I don't understand this proof at all. In the end we showed that $p-1$ divides $i$, but this doesn't mean that $i$ divides $p(p-1)$?
Can somebody help me out?
After you take $a=p$ you get :
$$(p+i)^{p+i} \equiv p^p \equiv 0 \pmod{p}$$ (you wrote something else )
This means that $p+i$ is divisible with $p$ so $i$ is divisible with $p$ .
Then I see that because $p \mid i$ you did $i=kp$ and so the problem is now:
$$(a+kp)^{a+kp} \equiv a^a \pmod{p}$$ for every $a$ .
Now I see that you understand why $$(a+kp)^{a+kp} \equiv a^{a+kp} \pmod{p}$$ (basically expanding the binomial all the terms with $kp$ cancel modulo $p$ )
This means that :
$$a^{a+kp} \equiv a^a \pmod{p}$$ for every $a$ .
Now if you take some $a$ coprime with $p$ you can then divide with that $a^a$ to deduce that :
$$a^{kp} \equiv 1 \pmod{p}$$
Now as you said take $a$ a primitive root modulo $p$ and deduce that : $$p-1 \mid kp=i$$
But we also proved that $p \mid i$ (because it's $i=kp$ )
Because $p$ and $p-1$ are coprime and both divide $i$ it follows that $p(p-1) \mid i$ as wanted .
If you have more questions don't hesitate to ask .