(4) Given that $f(x)$ is an even function defined on $\mathbf{R}$ with a period of 2, and when $0 \leqslant x \leqslant 1$, $f(x)=x^{2}$. If the line $y=\frac{1}{2} x+a$ intersects the graph of $y=f(x)$ at exactly two points, then ( ).
(A) $a=\frac{1}{2}$
(B) $a=k \quad(k \in \mathbf{Z})$
(C) $a=\frac{1}{2}+k$ or $a=k-\frac{1}{16}(k \in \mathbf{Z})$
(D) $a=2 k+\frac{1}{2}$ or $a=2 k-\frac{1}{16}(k \in \mathbf{Z})$
(4) $\mathrm{C}$ Hint: It is easy to know that when $-1 \leqslant x \leqslant 1$, $f(x)=x^{2}$. When the line passes through the point $(1, 1)$, $a=\frac{1}{2}$; when the line is tangent to the graph of $f(x)=x^{2}$, by
$$
\left\{\begin{array}{l}
y=x^{2}, \\
y=\frac{1}{2} x+a,
\end{array} \Rightarrow x^{2}-\frac{1}{2} x-a=0 .\right.
$$

So $\Delta=\frac{1}{4}+4 a=0, a=-\frac{1}{16}$, at this time the line intersects the graph of $y=f(x)$ at exactly two points.

By periodicity, if the line $y=\frac{1}{2} x+a$ satisfies, then $y=\frac{1}{2}(x+2 k)+a$ also satisfies, so $a=\frac{1}{2}+k$ or $a=k-\frac{1}{16} \quad(k \in \mathbf{Z})$, hence choose C.
(Supplied by Xiao Zhang Shengli from No.1 High School of Urumqi)