3. (11th "Hope Cup" Senior High School Competition Question) The graph of the periodic function $f(x)$ is roughly shown in Figure $1-1-8$. When $0 \leqslant x<\pi$, $f(x)=4 \cos \frac{x}{2}$. Then, the analytical expression of $f(x)$ on $(-\infty,+\infty)$ is
A. $\left|4 \cos \frac{x}{2}\right|$
B. $4 \cos \left(\frac{x}{2}+k \pi\right), k \pi \leqslant x<(k+1) \pi, k \in \mathbf{Z}$
C. $4 \cos \left(\frac{x-k \pi}{2}\right), k \pi \leqslant x<(k+1) \pi, k \in \mathbf{Z}$
D. $4 \cos \left(\frac{x+k \pi}{2}\right), k \pi \leqslant x<(k+1) \pi, k \in \mathbf{Z}$
3. $\mathrm{C}$ Using the method of special values, let $x=\pi$, it is easy to determine that the result is C.