8. The smallest positive period of the function $f(x)=|\sin x|-|\cos x|$ is

保留了源文本的换行和格式。
8. $\pi$. It is easy to know that $\pi$ is a period of $f(x)$. Now, we will use proof by contradiction to show that $\pi$ is its smallest positive period.

Assume $T(0<T<\pi)$ is a period of $f(x)$, then
$$
|\sin (x+T)|-|\cos (x+T)|=|\sin x|-|\cos x|
$$

holds for any $x \in \mathbf{R}$. Taking $x=0$, we get
$$
|\sin T|-|\cos T|=|\sin 0|-|\cos 0|=1
$$

However, when $0<T<\pi$, $0<|\sin T| \leqslant 1, 0<|\cos T|<1$, thus $-1<|\sin T|-|\cos T| \leqslant 1$, which is a contradiction. This shows that there does not exist a positive number $T$ that satisfies (1) and is less than $\pi$.