I saw the answer to this question and it is the same problem, but i didn't get how to use the tip S.C.B gave.
This was the tip:
$"$First, assume that it is not $a$ primitive root $(\text{mod m})$. Then we have that there exists such $r<\phi(m)$ such that $$a^r\equiv 1(\text{mod m})$$ Now use that, if $n=mk$ $$ϕ(mk)=ϕ(m)ϕ(k)\frac{d}{ϕ(d)}≥ϕ(m)ϕ(k)>rϕ(k)$$ where $d=gcd(m,k)"$
and i saw the answer to this question using group theory, but i want an answer using elementary number theory, if you have a different answer, or tip, it would be good as well.
What i tried was this:
$n=mk$, then $$a^{\phi(n)}\equiv 1(\text{mod n})\Rightarrow a^{\phi(mk)}\equiv1(\text{mod mk}) \Rightarrow a^{\phi(mk)}\equiv1(\text{mod m})$$
But i don't know how to follow from here