Example 2 Find the smallest positive period of the function $y=\cos (\sin x)$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
Solution: Since $\cos [\sin (x+\pi)]=\cos (-\sin x)=\cos (\sin x)$,
thus $\pi$ is a period of the function.
Assume $T$ is the smallest positive period of the function, and $0<T<\pi$, then for all real numbers $x$, $\cos [\sin (x+T)]$ $=\cos (\sin x)$ holds.
Let $x=0$, we get $\cos (\sin T)=1$. That is, $\sin T=2 k \pi(k \in \mathbf{Z})$.
Since $|\sin T| \leqslant 1$, only $k=0$ is possible, i.e., $\sin T=0$,
thus $T=n \pi(n \in \mathbf{Z})$, which contradicts $0<T<\pi$. Therefore, the smallest positive period of the function $y=\cos (\sin x)$ cannot be less than $\pi$.
Hence, the smallest positive period of $y=\cos (\sin x)$ is $\pi$.
Note: The equal period method can also be used to solve. Since $\cos u=\cos |u|$, and the function $f(u)=\cos u$ is monotonically decreasing on $u \in[0,1]$, so
$$
\begin{aligned}
& \cos [\sin (x+T)]=\cos (\sin x) \\
\Leftrightarrow & \cos |\sin (x+T)|=\cos |\sin x| \\
\Leftrightarrow & |\sin (x+T)|=|\sin x| .
\end{aligned}
$$

It is evident that the smallest positive period of $y=\cos (\sin x)$ is the same as that of $y=|\sin x|$, both being $\pi$.
In general, it can be proven that: $y=\underbrace{\sin \sin \cdots \sin x}_{n \uparrow}, y=\cos (\underbrace{\sin \sin \cdots \sin x}_{n}), y=\underbrace{\cos \cos \cdots \cos x}_{n}$ have the smallest positive periods of $2 \pi, \pi \cdot \pi$, respectively.