13. Given sets $A=\{(x, y) \mid a x+y=1\}, B=\{(x, y) \mid x+a y=1\}$, $C=\left\{(x, y) \mid x^{2}+y^{2}=1\right\}$, find:
(1) For what value of $a$ is $(A \cup B) \cap C$ a set containing two elements?
(2) For what value of $a$ is $(A \cup B) \cap C$ a set containing three elements?
13. (1) $(A \cup B) \cap C=(A \cap C) \cup(B \cap C)$,
$$
\begin{array}{l}
A \cap C=\left\{(x, y) \left\lvert\,\left\{\begin{array}{l}
a x+y=1 \\
x^{2}+y^{2}=1
\end{array}\right\}=\left\{(0,1),\left(\frac{2 a}{1+a^{2}}, \frac{1-a^{2}}{1+a^{2}}\right)\right\}\right.,\right. \\
B \cap C=\left\{(x, y) \left\lvert\,\left\{\begin{array}{l}
x+a y=1 \\
x^{2}+y^{2}=1
\end{array}\right\}=\left\{(1,0),\left(\frac{1-a^{2}}{1+a^{2}}, \frac{2 a}{1+a^{2}}\right)\right\}\right.,\right.
\end{array}
$$

To make $(A \cup B) \cap C$ have two elements, then $\left\{\begin{array}{l}\frac{2 a}{1+a^{2}}=0 \\ \frac{1-a^{2}}{1+a^{2}}=1\end{array}\right.$ or $\left\{\begin{array}{l}\frac{2 a}{1+a^{2}}=1 \\ \frac{1-a^{2}}{1+a^{2}}=0,\end{array}\right.$ solving gives $a=0$ or $a=1$.
(2) $\frac{2 a}{1+a^{2}}=\frac{1-a^{2}}{1+a^{2}}$, we get $a=-1 \pm \sqrt{2}$.