Example 3 Find all integer pairs $(m, n)(m, n \geqslant 2)$, such that for any integer $x$ we have
$$
x^{n} \equiv x(\bmod m)
$$
If there is a prime $p$ such that $p^{2} \mid m$, taking $x=p$ leads to a contradiction.
Therefore, $m=p_{1} p_{2} \cdots p_{k}$ (where $p_{i}$ are distinct primes).
Furthermore, $x^{n} \equiv x(\bmod m)$ is equivalent to the system of congruences
$x^{n} \equiv x\left(\bmod p_{i}\right) \quad(1 \leqslant i \leqslant k)$.
Taking $x$ to be a primitive root modulo $p_{i}$, we get
$\left(p_{i}-1\right) \mid(n-1)$.
Thus, $n=1+u\left[p_{1}-1, p_{2}-1, \cdots, p_{k}-1\right]$.
On the other hand, for any distinct primes $p_{i}$, when $\left(x, p_{i}\right)=1$, we have
$\delta_{p_{i}}(x) \mid\left(p_{i}-1\right)$.
Thus, $\delta_{p_{i}}(x) \mid(n-1)$.
Hence, $x^{n} \equiv x\left(\bmod p_{i}\right)$ (this also holds when $p_{i} \mid x$). Therefore, all integer pairs $(m, n)$ that satisfy the requirement are $m=p_{1} p_{2} \cdots p_{k}, n=1+u\left[p_{1}-1, p_{2}-1, \cdots, p_{k}-1\right]$, where $k, u$ are any positive integers, and $p_{i}$ are any distinct primes.