Example 2 Let $p$ be an odd prime satisfying $p \equiv 1(\bmod 4)$, calculate $\sum_{k=1}^{p-1}\left\{\frac{k^{2}}{p}\right\}$, where $\{x\}=x-[x],[x]$ is the greatest integer not exceeding $x$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
From "Example 1" we know that when $p \equiv 1(\bmod 4)$, -1 is a quadratic residue modulo $p$. Suppose $a$ is also a quadratic residue modulo $p$. By Euler's criterion, $(-a)^{\frac{p-1}{2}} \equiv (-1)^{\frac{p-1}{2}} \cdot a^{\frac{p-1}{2}} \equiv 1(\bmod p)$. Thus, $-a$ is also a quadratic residue modulo $p$. Therefore, the set of quadratic residues modulo $p$, $\left\{1^{2}, 2^{2}, \cdots, \left(\frac{p-1}{2}\right)^{2}\right\}$, is equivalent modulo $p$ to $\left\{a_{1}, p-a_{1}, a_{2}, p-a_{2}, \cdots, a \frac{p-1}{4}, p-a \frac{p-1}{4}\right\}$. Furthermore, when $1 \leqslant a_{i}, p-a_{i} < p$, we have $\left\{\frac{a_{i}}{p}\right\} + \left\{\frac{p-a_{i}}{p}\right\} = \frac{a_{i}}{p} + \frac{p-a_{i}}{p} = 1$.

Therefore, $\sum_{k=1}^{p-1}\left\{\frac{k^{2}}{p}\right\} = 2 \sum_{k=1}^{\frac{p-1}{2}}\left\{\frac{k^{2}}{p}\right\} = 2 \cdot \sum_{i=1}^{\frac{p-1}{4}}\left(\left\{\frac{a_{i}}{p}\right\} + \left\{\frac{p-a_{i}}{p}\right\}\right) = \frac{p-1}{2}$.

Below is an example of a quadratic congruence equation.