Find all functions $f: \mathbb{Z} \rightarrow \mathbb{Z}$ that satisfy

- $f(p)>0$ for all prime numbers $p$,
- $p \mid (f(x) + f(p))^{f(p)} - x$ for all $x \in \mathbb{Z}$ and all prime numbers $p$.
Substitute $x=p$ into: $p \mid (2 f(p))^{f(p)}-p$ and $p$ is prime, so $p \mid 2 f(p)$. We see that $p=2$ or $p \mid f(p)$. Now substitute $x=0$: $p \mid (f(0)+f(p))^{f(p)}-0$ and $p$ is prime, so $p \mid f(0)+f(p)$. Since $p \mid f(p)$ for $p \neq 2$, we now also see that $p \mid f(0)$ for $p \neq 2$. Therefore, $f(0)$ is divisible by infinitely many prime numbers and must therefore be 0. Now it follows from $2 \mid f(0)+f(2)$ that $2 \mid f(2)$, so $p \mid f(p)$ for all prime numbers $p$.
The given divisibility relation can now be translated to $f(x)^{f(p)} \equiv x \bmod p$ for all integers $x$ and prime numbers $p$. We see that $p \mid f(x)$ if and only if $p \mid x$. If we now apply this for $x=q$ with $q$ a prime number different from $p$, we see that $f(q)$ is not divisible by any $p \neq q$ and must therefore be a power of $q$. Fermat's little theorem states for all prime numbers $p$ and integers $n$ that $n^{p} \equiv n \bmod p$, so also $n^{p^{t}} \equiv n \bmod p$ for all positive integers $t$. Now $f(p)$ for all prime numbers $p$ is of the form $p^{t}$ with $t$ a positive integer, so from the given divisibility relation we can now conclude that $f(x) \equiv x \bmod p$ for all integers $x$ and prime numbers $p$. Therefore, $p \mid f(x)-x$ for all $x$ and $p$. So for a fixed $x \in \mathbb{Z}$, $f(x)-x$ is divisible by infinitely many prime numbers $p$, from which it follows that $f(x)-x=0$. Therefore, $f(x)=x$ for all $x$.
We check this function. It is indeed true that $f(p)>0$ for prime numbers $p$. And further,

$$
(f(x)+f(p))^{f(p)}-x=(x+p)^{p}-x \equiv x^{p}-x \equiv 0 \quad \bmod p
$$

for all $x \in \mathbb{Z}$ and all prime numbers $p$. So the function $f(x)=x$ satisfies.