3. Given the sequence $0,1,1,2,2,3,3,4,4, \cdots$ with the sum of the first $n$ terms as $f(n)$. For any positive integers $p, q(p>q)$, $f(p+q)-f(p-q)=(\quad)$.
(A) $p^{2}+q^{2}$
(B) $2\left(p^{2}+q^{2}\right)$
(C) $p q$
(D) $2 p q$
3.C.

It is known that, $f(n)=\left\{\begin{array}{ll}\frac{n^{2}-1}{4}, & n \text { is odd; } \\ \frac{n^{2}}{4}, & n \text { is even. }\end{array}\right.$
Since $p+q$ and $p-q$ have the same parity, we consider two cases.
(1) If $p+q$ and $p-q$ are both odd, then
$$
\begin{array}{l}
f(p+q)-f(p-q) \\
=\frac{(p+q)^{2}-1}{4}-\frac{(p-q)^{2}-1}{4}=p q ;
\end{array}
$$
(2) If $p+q$ and $p-q$ are both even, then
$$
f(p+q)-f(p-q)=\frac{(p+q)^{2}}{4}-\frac{(p-q)^{2}}{4}=p q .
$$