Example 9 Let $A=\{x \mid-1 \leqslant x \leqslant a\} \neq \varnothing, B=\{y \mid y=x+1, x \in A\}, C=$ $\left\{y \mid y=x^{2}, x \in A\right\}$, If $B=C$, find the value of the real number $a$.
From the given information, we have $B=\{y \mid 0 \leqslant y \leqslant 1+a\}$. If $-1 \leqslant a1$, then $C=\left\{y \mid 0 \leqslant y \leqslant a^{2}\right\}$, thus,
$$
\left\{\begin{array} { l } 
{ - 1 \leqslant a 1, \\
a^{2}=a+1,
\end{array}\right.\right.\right.
$$

Therefore, $a=0$ or $a=\frac{1+\sqrt{5}}{2}$.