I'm a bit confused about the nature of one of my homework problems. It is requesting an explanation for why a congruence holds for $a^n \equiv a \;(\!\!\!\mod n)$ for a composite $n$, however this congruence is not always true from my understanding as having $a^n \not\equiv a \;(\!\!\!\mod n)$ provides that $n$ is not prime in the case that this occurs so the equivalence may not always be true. The question is however prefaced by the given $n$ being a Carmichael number though. Could anyone hint at how I should approach this explanation?
The Problem
The number 561 factors as $3 \cdot 11 \cdot 17$. First use Fermat's little theorem to prove that \begin{equation*} a^{561} \equiv a \;(\!\!\!\mod{3}), \quad a^{561} \equiv a \;(\!\!\!\mod{11}), \quad a^{561} \equiv a \;(\!\!\!\mod{17}) \end{equation*} for every value of $a$. Then explain why these three congruences imply that $a^{561} \equiv a \;(\!\!\!\mod{561})$ for every value of $a$.
Current Solution
Fermat's little theorem states that given a prime $p$, for every $a\in(\mathbb{Z}/p\mathbb{Z})^{\ast}$, \begin{equation*} a^{p-1} \equiv 1 \;(\!\!\!\mod{p}). \end{equation*} Then by Fermat's little theorem, \begin{equation*} a^{561} = a^{2\cdot28}a = \big(a^{28}\big)^2a \equiv a \;(\!\!\!\mod{3}), \end{equation*} \begin{equation*} a^{561} = a^{56 \cdot 10}a = \big(a^{56}\big)^{10}a \equiv a \;(\!\!\!\mod{11}), \end{equation*} \begin{equation*} a^{561} = a^{35\cdot16}a = \big(a^{35}\big)^{16}a \equiv a \;(\!\!\!\mod{17}). \end{equation*}
$a^{187} = a^{3\cdot62}a^1 \equiv a^{62}a^1 = a^{3\cdot21} \equiv a^{21}=a^{3\cdot7}\equiv a^7 = a^{2\cdot3}a^1 \equiv a^2a^1 = a^3 \equiv a \mod 3$
– Alex Jul 21 '13 at 23:50