explain why $3|n$ with the following conditions.. If $ord_ma=3$ and if $a^n\equiv 1 \pmod{m}$ for some $n\ge1$, explain why $3|n$.
Attempt at solution:
We know that $ord_ma=3$ means $a^3\equiv 1 \pmod{m}$.  Therefore, $n$ is a multiple of $3$, because $a^{3n}\equiv 1 \pmod{m}$.

The reasoning is incomplete. First note that $\text{ord}_m(a)=3$ means that $a^3\equiv 1\pmod{m}$ and for any positive integer $k \lt 3$, we have $a^k\not\equiv 1\pmod{m}$.
Now we proceed to show that if $a^n\equiv 1\pmod{m}$, where $n\ge 1$, then $3$ divides $n$. 
Suppose to the contrary that $3$ does not divide $n$. Then if we attempt to divide $n$ by $3$, we get a non-zero remainder. More precisely, $n=3q+k$ where $k=1$ or $k=2$. Then
$$a^n=a^{3q+k}=(a^3)^qa^k.$$
But since $a^3\equiv 1\pmod{m}$, it follows that 
$(a^3)^q\equiv 1\pmod{m}$, and therefore $a^n\equiv a^k\pmod{m}$. Thus $a^k\equiv 1\pmod{m}$. Since $k=1$ or $k=2$, this  contradicts the fact that $a$ has order $3$ modulo $m$.
