Example 4 Given $p$ is a given prime number, find the smallest positive integer $m$ satisfying: (1) $1 \leqslant m \leqslant p-1$; (2) $\sum_{k=1}^{p-1} k^{m} \equiv$ $0(\bmod p)$.
(1) First, we prove that $m \neq p-1$.
For $1 \leqslant k \leqslant p-1$, by Fermat's Little Theorem, $k^{p-1} \equiv 1(\bmod p)$,
so $\sum_{k=1}^{p-1} k^{p-1} \equiv \sum_{k=1}^{p-1} 1 \quad(\bmod p) \equiv p-1 \quad(\bmod p)$.
Therefore, $p \times \sum_{k=1}^{p-1} k^{p-1}$. Hence, $m \neq p-1$.
(2) Next, we prove that $m=p-2$ satisfies the requirement.
Consider the congruence equation $x^{p-2} \equiv 1(\bmod p)$, this equation has at most $p-2$ solutions, so there exists $a \in\{1,2, \cdots, p-1\}$, such that $a^{p-2} \neq 1(\bmod p)$.
Also, $1,2, \cdots, p-2, p-1$ form a reduced residue system modulo $p$,
and clearly $(a, p)=1$, so $a, 2a, \cdots, a(p-2), a(p-1)$ also form a reduced residue system modulo $p$.
Thus, $\sum_{k=1}^{p-1} k^{p-2} \equiv \sum_{k=1}^{p-1}(k a)^{p-2}(\bmod p)$, which means $p \mid\left(a^{p-2}-1\right) \sum_{k=1}^{p-1} k^{p-2}$,
and since $p \times a^{p-2}-1, p$ is a prime, we have $\left(p, a^{p-2}-1\right)=1$.
Therefore, $p \mid \sum_{k=1}^{p-1} k^{p-2}$.
Thus, the maximum value of $m$ that satisfies the requirement is $p-2$.