II. (14 points) Let $f(x)=\sqrt{a x^{2}+b x}$. Find the value of the real number $a$ such that: there exists at least one positive number $b$ for which the domain and range of $f(x)$ are the same.
If $a=0$, then for each positive number $b, f(x)=\sqrt{b x}$ has both its domain and range as $[0,+\infty)$, so $a=0$ satisfies the condition.

If $a>0$, then for positive number $b, f(x)=\sqrt{a x^{2}+b x}$ has the domain
$$
\begin{array}{l}
D=\left\{x \mid a x^{2}+b x \geqslant 0\right\} \\
=\left(-\infty,-\frac{b}{a}\right] \cup[0,+\infty) .
\end{array}
$$

However, the range $A \subseteq[0,+\infty)$ of $f(x)$, so $D \neq A$, meaning $a>0$ does not satisfy the condition.

If $a<0$, then for positive number $b, f(x)=\sqrt{a x^{2}+b x}$ has the domain $D=\left[0,-\frac{b}{a}\right]$. Since in this case
$$
(f(x))_{\max }=f\left(-\frac{b}{2 a}\right)=\frac{b}{2 \sqrt{-a}},
$$

the range of $f(x)$ is $\left[0, \frac{b}{2 \sqrt{-a}}\right]$.
$$
\begin{array}{l}
\text { then }-\frac{b}{a}=\frac{b}{2 \sqrt{-a}} \\
\Leftrightarrow\left\{\begin{array}{l}
a<0, \\
2 \sqrt{-a}=-a
\end{array} \Leftrightarrow a=-4 .\right.
\end{array}
$$

In summary, the value of $a$ is 0 or -4.