3. Let $a$ be an integer, and the two real roots of the equation $x^{2}+(a-3) x+a^{2}=0$ be $x_{1}$ and $x_{2}$. If $\tan \left(\arctan x_{1}+\arctan x_{2}\right)$ is also an integer, then the number of such $a$ is ( ).
(A) 0
(B) 1
(C) 2
(D) 4
3. (B).

By Vieta's formulas, we have $x_{1}+x_{2}=3-a, x_{1} x_{2}=a^{2}$. Using the tangent addition formula, we get
$$
\begin{array}{l}
\tan \left(\arctan x_{1}+\arctan x_{2}\right) \\
=\frac{\tan \left(\arctan x_{1}\right)+\tan \left(\arctan x_{2}\right)}{1-\tan \left(\arctan x_{1}\right) \tan \left(\arctan x_{2}\right)} \\
=\frac{x_{1}+x_{2}}{1-x_{1} x_{2}}=\frac{3-a}{1-a^{2}}=\frac{3-a}{(1-a)(1+a)} \in \mathbf{Z} .
\end{array}
$$

Therefore, $(1-a) \mid(3-a)=(1-a)+2$.
Thus, $(1-a) \mid 2$. Hence, $a$ can take the values $0,2,-1,3$. Upon verification, only $a=0$ meets the requirement (including the discriminant $\Delta \geqslant 0$ ).

Note: It is easy to mistakenly answer (C). In fact, when $a=3$, the original equation has no real roots.