I'm trying to prove intuitively that there exists a number $k$ such that
$$a^k \equiv 1 (m),$$
iff $a$ and $m$ are coprime.
One of the ways of the proof is easy: If $a^k \equiv 1 (m)$, then that means $a^k = pm+1$ for some integer $p$. Since all consecutive numbers are coprime, then $a^k$ and $pm$ are coprime, which directly implies that $a$ and $m$ are also coprime.
However, I don't know how to prove the other direction of the statement, that is, if $a$ and $m$ are coprime, then there exists a number $k$ such that $a^k \equiv 1 (m)$, without invoking permutation properties of the reduced residue system modulo $m$ as shown in here.