Find the number of ordered quadruples $(a,b,c,d)$ of real numbers such that
\[\begin{pmatrix} a & b \\ c & d \end{pmatrix}^2 = \begin{pmatrix} c & a \\ d & b \end{pmatrix}.\]
We have that
\[\begin{pmatrix} a & b \\ c & d \end{pmatrix}^2 = \begin{pmatrix} a^2 + bc & ab + bd \\ ac + cd & bc + d^2 \end{pmatrix}.\]Comparing entries, we find
\begin{align*}
a^2 + bc &= c, \\
ab + bd &= a, \\
ac + cd &= d, \\
bc + d^2 &= b.
\end{align*}Subtracting the first and fourth equations, we get
\[a^2 - d^2 = c - b,\]which factors as $(a + d)(a - d) = c - b.$

But
\[a - d = (ab + bd) - (ac + cd) = (a + d)(b - c),\]so $(a + d)^2 (b - c) = c - b.$  Then
\[(a + d)^2 (b - c) + (b - c) = 0,\]which factors as $(b - c)[(a + d)^2 + 1] = 0.$  Hence, $b = c,$ which forces $a = d.$  The equations above then become
\begin{align*}
a^2 + b^2 &= b, \\
2ab &= a, \\
2ab &= a, \\
a^2 + b^2 &= b.
\end{align*}From $2ab = a,$ $2ab - a = a(2b - 1) = 0,$ so $a = 0$ or $b = \frac{1}{2}.$

If $a = 0,$ then $b^2 = b,$ so $b = 0$ or $b = 1.$

If $b = \frac{1}{2},$ then
\[a^2 = b - b^2 = \frac{1}{4},\]so $a = \pm \frac{1}{2}.$

Thus, we have $\boxed{4}$ solutions $(a,b,c,d),$ namely $(0,0,0,0),$ $(0,1,1,0),$ $\left( \frac{1}{2}, \frac{1}{2}, \frac{1}{2}, \frac{1}{2} \right),$ and $\left( -\frac{1}{2}, \frac{1}{2}, \frac{1}{2}, -\frac{1}{2} \right).$