2. The smallest positive period of the function $f(x)=4 \sin ^{3} x-\sin x+2\left(\sin \frac{x}{2}-\cos \frac{x}{2}\right)^{2}$ is
A. $2 \pi$
B. $\frac{\pi}{2}$
C. $\frac{2 \pi}{3}$
D. $\pi$
$$
f(x)=4 \sin ^{3} x-\sin x+2(1-\sin x)=4 \sin ^{3} x-3 \sin x+2=-\sin 3 x+2, \quad T=\frac{2 \pi}{3},
$$

So the answer is $C$.