Let $G=(g^i)_{i\in\mathbb{N}},\ H=(h^i)_{i\in\mathbb{N}}$ be finite cyclic groups such that $(g,h)$ generates $G\times H$. I want to prove that $\gcd(|g|,|h|)=1$ (where $|g|=|G|$,etc)
Let $k\in\mathbb{Z}$ such that $(g,h)^k=(g,h^2)$. Then, $$k=1\mod|g|,\quad k=2\mod|h|$$ So, we can take $\alpha,\beta\in\mathbb{Z}$ such that $k=1+\alpha|g|=2+\beta|h|$. From this we get $\alpha|g|-\beta|h|=1$ and, then, by Bezout's lemma, we finally deduce that $|g|$ and $|h|$ are coprime.
Is this correct? A Yes or No is enough