How can I show that the order of an element modulo $m$ divides $\phi(m)$?
I know that if $a$ and $m$ are relatively prime, then the least positive integer $x$ such that $a^x\equiv1\pmod m$ is its order modulo $m$. I also know that, by Euler's theorem, $a^{\phi(m)}\equiv1\pmod m$. Therefore, it must be the case that $x\leq\phi(m)$
However, all that I am left to do is to show that $kx=\phi(m)$, for some integer $k$. Do you guys have an idea on how to do this? Thanks in advance!
Hint: Let $\phi(m)=xq+r$, where $0\le r<x$. Show that $a^r\equiv 1 \pmod{m}$. This contradicts the definition of $x$, unless $r=0$.