Example 3 Let $p$ be a given odd prime, and call a positive integer $m$ a "good number" if it satisfies the following conditions:
(1) $m \in\{1,2, \cdots, p-1\}$;
(2) there exists $n \in \mathbf{N}^{*}$, such that $m^{n} \equiv-1(\bmod p)$.
Find the number of "good numbers".
Let $g$ be a primitive root modulo $p$, then $g^{\frac{p-1}{2}} \equiv -1 \pmod{p}$. (Because $\delta_{p}(g)=p-1$, and $g^{p-1} \equiv 1 \pmod{p}$, and $g, g^{2}, \cdots, g^{p-1}$ form a reduced residue system modulo $p$.)

Now for $m \in \{g, g^{2}, \cdots, g^{p-1}\}$, let $m=g^{k}$. According to the definition of "good numbers", $m$ is a "good number" if and only if there exists $n \in \mathbf{N}^{*}$ such that
$$k n = \frac{p-1}{2} \cdot q$$

where $q$ is a positive odd number. This is equivalent to the power of 2 in the prime factorization of $k$ being no greater than the power of 2 in $\frac{p-1}{2}$.

Let $\frac{p-1}{2} = 2^{a} \cdot u$, where $a \in \mathbf{N}^{*}$ and $u$ is an odd number. Then $m = g^{k}$ meets the requirement if and only if $k \notin \{2^{a+1}, 2^{a+1} \cdot 2, \cdots, 2^{a+1} \cdot u\}$.

In summary, there are $p-1-u$ "good numbers", where $u$ is the largest odd divisor of $p-1$.