So, I'm working my way through Artin, with the help of the wonderful lectures of Professor Gross, and following the required homework he asks in his class, and I'm not completely sure about one of them.
This is the question:
Let $G, H$ be cyclic groups, generated by elements $x, y$. Determine the condition on the orders $m, n$ of $x$ and $y$ so that the map sending $x^i$ to $y^i$ is a group homomorphism.
I got to the conclusion that the condition is that $n \mid m$ (this answer helped verifying that, that one not so much), but there are still some points I'm no sure about.
My reasoning is as follows:
Let $\varphi$ be a homomorphism from $G$ to $H$, it must then respect $y^i=\varphi(x^i)=\varphi(x^mx^i)=\varphi(x^m)\varphi(x^i)=y^my^i$ thus $y^m=1_H=(y^n)^k=y^{nk}$ from which we deduce $m=nk$ so $n \mid m$, and in the end $\varphi$ is a homomorphism from $G$ to $H$ if $n \mid m$.
However I'm not that sure about that proof and it feels sketchy to me. Should I have done it the other way around, from $n \mid m$ to implying that $\varphi$ is a homomorphism? I also don't talk about $\varphi$ being well-defined, should I have, or is the proof enough as it is?
Thank you in advance for your clarifications! :)