Assume $1 \le n$. And $x \in Z_n = \{0,1,2,..n-1\}$. Assume in addition that for some $k>0$,
$kx = 0 \pmod n$, i.e. $\,n\mid kx$. And assume $k\mid n$.
Is it then true that $\gcd(n,x)=n/k $, where $\gcd=$ greatest common divisor? Note by the assumptions, $n/k$ must divide both $n$ and $x$, but how can I show that this is in fact the greatest common divisor? Thanks,
If you suppose $gcd(n,x)=1$, as another answer states it, it is clear.
If you don't, then the result is false : take $n=16$, $k=4$ and $x=8$.