5 The number of roots of the equation $\left.a x^{2}+b|x|+c=0(a, b, c \in \mathbf{R}), a \neq 0\right)$ in the set of complex numbers is $n$, then
A. $n$ is at most 2
B. $n$ is at most 4
C. $n$ is at most 6
D. $n$ is at most 8
5 C. Let's assume $a=1$.
Since $b$, $c$, and $|x|$ are all real numbers, $x^2$ must be a real number, meaning $x$ is either a real number or a pure imaginary number.
If $x$ is a real number $u$, then
$$
u^{2}+b u+c=0(u \geqslant 0)
$$

or
$$
u^{2}-b u+c=0(u<0)
$$

If $x$ is a pure imaginary number $vi$, then
$$
v^{2}-b v-c=0(v \geqslant 0)
$$

or
$$
v^{2}+b v-c=0(v<0)
$$

When $b$ and $c$ have opposite signs, there are 6 roots that satisfy the conditions. In other cases (including when at least one of $b$ and $c$ is 0), the number of roots that satisfy the conditions is less than 6.