3. (2004 National College Entrance Examination - Tianjin Paper) The function $f(x)$ defined on $\mathbf{R}$ is both an even function and a periodic function. If the smallest positive period of $f(x)$ is $\pi$, and when $x \in\left[0, \frac{\pi}{2}\right]$, $f(x)=\sin x$, then the value of $f\left(\frac{5}{3} \pi\right)$ is
A. $-\frac{1}{2}$
B. $\frac{1}{2}$
C. $-\frac{\sqrt{3}}{2}$
D. $\frac{\sqrt{3}}{2}$
3. $\mathrm{D} f\left(\frac{5}{3} \pi\right)=f\left(-\frac{\pi}{3}\right)=f\left(\frac{\pi}{3}\right)=\frac{\sqrt{3}}{2}$