Example 2 Given that the circle $x^{2}+y^{2}=k^{2}$ covers at least one maximum point and one minimum point of the function $f(x)=\sqrt{3} \sin \frac{\pi x}{k}$, find the range of real number $k$.

This problem is somewhat misleading. If you don't think carefully when you get the problem, you might do this: "Let's assume the given circle covers the maximum point $A$ and the minimum point $B$ of $f(x)$. The coordinates of $A$ and $B$ are respectively......" If you do this, the solution will be more complicated. However, with a little observation, you can find that both the given circle and the function have special properties: they are both centrally symmetric about the origin $O$. And we know that a maximum point of $f(x)$, after being centrally symmetric about the origin, becomes a minimum point of $f(x)$.

Solution: $f(x)$ is an odd function, and its graph is centrally symmetric about the origin. The circle $x^{2}+y^{2}=k^{2}$ is centered at the origin and is also centrally symmetric about the origin. Therefore, it is sufficient for the circle to cover a maximum point of $f(x)$. $f_{\text {max }}(x)=\sqrt{3}$, which is achieved if and only when $x=k\left(2 l+\frac{1}{2}\right)(l \in \mathbf{Z})$. Therefore, the maximum point of $f(x)$ closest to the origin is $\left(\frac{k}{2}, \sqrt{3}\right)$. According to the problem, it is sufficient for this point to be inside the circle, i.e., $k^{2} \geqslant \left(\frac{k}{2}\right)^{2}+3$, solving which gives $|k| \geqslant 2$. In summary, the range of $k$ is $(-\infty,-2] \cup[2,+\infty)$.