$C=\left\{(x, y) \mid x^{2}+y^{2}=1\right\}$. Questions:
(1) For what value of the real number $a$ is $(A \cup B) \cap C$ a 2-element set?
(2) For what value of the real number $a$ is $(A \cup B) \cap C$ a 3-element set?
Obviously, $(0,1) \in A \cap C, (1,0) \in B \cap C$, so, $(0,1), (1,0) \in (A \cup B) \cap C$.
(1) When $a=0$, the lines $a x+y=1$ and $x+a y=1$ are both tangent to the circle $x^{2}+y^{2}=1$, $(A \cup B) \cap C - \{(0,1), (1,0)\}$.
When $a=1$, the lines $a x+y=1$ and $x+a y=1$ coincide, which is the line connecting $(0,1)$ and $(1,0)$. $(A \cup B) \cap C = \{(0,1), (1,0)\}$.
When $a \neq 0,1$, the line $a x+y=1$ intersects the circle $x^{2}+y^{2}=1$ at a point different from $(0,1)$ and $(1,0)$, $|(A \cup B) \cap C| \geqslant 3$.
Therefore, $a=0,1$.
(2) In this case, $a \neq 0,1$, and the other intersection point of the line $a x+y=1$ with the circle $x^{2}+y^{2}=1$ is also the other intersection point of the line $x+a y=1$ with the circle $x^{2}+y^{2}=1$, i.e., this point is the intersection of $a x+y=1$ and $x+a y=1$, thus $x=y=\frac{1}{a+1}$, substituting into $x^{2}+y^{2}=1$ gives $x=y= \pm \frac{1}{\sqrt{2}}, a=-1 \pm \sqrt{2}$.