I understand the implication of the Fermat-Euler theorem and how it applies to RSA and the detailed explanation by user Ninefingers at What is the relation between RSA & Fermat's little theorem? is very useful.
However, the Fermat-Euler Theorem states that $a$ and $n$ should be relatively prime to satisfy the following equation. $$ a^{\phi\left(n\right)}\equiv1\mod n $$ But I do not recall RSA stating any exceptions of $a$ which cannot be properly encrypted
Edit: Note that I have seen Does RSA work for any message M? which is very similar BUT the question is different and thus the given answer satisfies it however the answer does not show or prove why the fermat's theorem could still be used.
Edit 2: The reason it is a different question is because I am looking for the number theory function which enables the cryptographic system to work the way it does.