# Group Homomorphisms between $Z_n$ and $Z_m$ and the order of $f(1)$

I have to show that if $f$ is a group homomorphism between $\mathbb{Z}_n$ and $\mathbb{Z}_m$, then there exists $r \in \mathbb{Z}_m$ such that $f(x) = rx$ (took $r = f(1)$) and that the order of $r$ seen as an element of $\mathbb{Z}_n$ divides $\text{gcd}(n,m)$. Let $[r]_n$ be $r$ seen as an element of $\mathbb{Z}_n$ and $\#x$ be the order of $x$. Now, I have trouble seeing why $\#[r]_n$ divides $\text{gcd}(n,m)$. By Lagrange's Theorem it follows that $\#[r]_n \mid n$. I've seen other entries on the page and all of them say the same: "the order of 1 is $n$, then the order of $f(1)$ divides $n$ and divides $m$ by Lagrange", but they are considering $f(1)$ as an element of $\mathbb{Z}_m$. My first attempt to solve this was:

1. $m = q\#[r]_n + k, 0 \leq k < \#[r]_n$. Suppose $k > 0$,
2. (Lagrange in $\mathbb{Z}_m$) $f(m[r]_n) = mf([r]_n) = 0$,
3. (Lagrange in $\mathbb{Z}_n$) $f(m[r]_n) = f((q\#[r]_n+k)[r]_n) = f(k[r]_n) = kf([r]_n)$,
4. By 2 and 3, $kf([r]_n) = 0$.

I would like to prove that this leads to a contradiction and that $k$ must be $0$, however, I can't see it. This made me wonder if it is true that $\#[r]_n \mid m$. Can someone see it?

• Surely this is not how the question was phrased. Writing $f(x)=rx$ where $f:\mathbb Z_n\to\mathbb Z_m$ is sketchy. An element of $\mathbb Z_n$ may not be associated uniquely to an element of $\mathbb Z_m$, in which case you're unjustifiably treating $1\in \mathbb Z_n$ like $1\in \mathbb Z$. – Matt Samuel Mar 18 '17 at 19:09
• I know $f$ is a group homomorphism, and 1 generates the whole $\mathbb{Z}_n$, then $x = 1+ 1+ \ldots + 1$ x-times, and $f(x)=f(1+\ldots+1) = f(1)+\ldots+f(1)=xf(1)$ for every $x\in \mathbb{Z}_n$, then the $r$ I'm looking for is $f(1)$. I'm treating 1 as an element of $\mathbb{Z}_n$ – Gilberto López Mar 18 '17 at 19:44