I am trying to answer the following question:
Let $G$ and $H$ be two cyclic groups generated by $x$ and $y$ respectively. Determine the condition on the orders $m$ and $n$ of $x$ and $y$ so that the map $f(x^i)= y^i$ is a homomorphism.
How I attempted to solve the question in the following way: Let $r$ and $s$ be two arbitrary integers. Then $$f(x^rx^s) = f(x^{r+s})=y^{r+s}=y^ry^s=f(x^r)f(x^s)$$ Since we made no assumptions about the orders of $x$ and $y$, $f$ is an homomorphism from $G$ to $H$ no matter what the orders of $x$ and $y$ are.
I don't feel confident with my proof and I would love for someone to check it. Finally, I am aware there are some theorems about the order elements of a groups but I am supposed to solve the problem without them.
Let $g_1, g_2 \in G$. We then have that $g_1=x^{k_1}$ and $g_2=x^{k_2}$ for $k_1,k_2 \in \mathbb{Z}$. Let $f$ be a homomorphism. Then $$f(g_1g_2)=f(x^{k_1}x^{k_2})=f(x^{k_1+k_2})=f(g_1)f(g_2)=f(x^{k_1})(x^{k_2})=y^{k_1}y^{k_2}=y^{k_1+k_2}.$$
Further, recall that for any group homomorphism $\varphi: G \to H$ that for $g \in G$ we have that $|\varphi(g)|$ divides $|g|$.
Thus from above we must have that $|y^{k_1+k_2}|$ divides $|x^{k_1+k_2}|$. And since $G=\langle x \rangle$ and $H=\langle y \rangle$ with $|x|=m$ and $|y|=n$, it clearly follows that $G \cong \mathbb{Z}/m\mathbb{Z}$ and $H \cong \mathbb{Z}/n\mathbb{Z}$. Therefore $$|y^{k_1+k_2}|=\frac{n}{\gcd(k_1+k_2,n)},$$ $$|x^{k_1+k_2}|=\frac{m}{\gcd(k_1+k_2,m)}.$$ Using that the first expression divides the second, we have for $r \in \mathbb{Z}$ $$|x^{k_1+k_2}|=\frac{m}{\gcd(k_1+k_2,m)}=|y^{k_1+k_2}|\cdot r = \frac{nr}{\gcd(k_1+k_2,n)}$$ Providing us with $$m=\frac{\gcd(k_1+k_2,m)}{\gcd(k_1+k_2,n)} \cdot nr$$