(ㅗㄱ 5 Let $A=\left\{x \mid x^{2}+4 x=0\right\}, B=\left\{x \mid x^{2}+2(a+1) x+a^{2}-1=0\right.$, $x \in \mathbf{R}\}$, if $B \subseteq A$, find the range of real number $a$.
Given that $A=\{0,-4\}$, since $B \subseteq A$, we have $B=\varnothing$ or $B=\{0\}$ or $B=\{-4\}$ or $B=\{0,-4\}$.
When $B=\varnothing$, $\Delta=4(a+1)^{2}-4\left(a^{2}-1\right)<0$, solving this gives $a<-1$;
When $B=\{0\}$, $\left\{\begin{array}{l}0^{2}+2(a+1) \cdot 0+a^{2}-1=0, \\ \Delta=4(a+1)^{2}-4\left(a^{2}-1\right)=0,\end{array}\right.$ solving this gives $a=-1$;
When $B=\{-4\}$, $\left\{\begin{array}{l}(-4)^{2}+2(a+1) \cdot(-4)+a^{2}-1=0, \\ \Delta=4(a+1)^{2}-4\left(a^{2}-1\right)=0,\end{array}\right.$ solving this gives $a \in \varnothing$;
When $B=\{0,-4\}$, $\left\{\begin{array}{l}0^{2}+2(a+1) \cdot 0+a^{2}-1=0, \\ (-4)^{2}+2(a+1) \cdot(-4)+a^{2}-1=0,\end{array}\right.$ solving this gives $a=1$.
Therefore, the range of real number $a$ is $(-\infty,-1] \cup\{1\}$.
Solution Guidance When one set is a subset of another set, do not forget that “$\varnothing$ is a subset of any set and a proper subset of any non-empty set”. In particular, when the quadratic coefficient of a quadratic equation in one variable contains a letter, pay attention to the case where the quadratic coefficient is zero, i.e., the equation is a linear equation in one variable.