I have the following problem
Let $G$ and $G_1$ be finite groups such that $\gcd(|G|,|G_1|)=1$, and let $\phi:G\to G_1$ be a group homomorphism. Prove that $ker \phi=G$.
We can assume $\ker\phi$ is a subgroup of $G$.
My attempted proof is as follows:
It would be highly appreciated if someone could help to prove this as I am preparing for a group theory test. Thanks :)

Here is a proof using only basic facts.
Take any $x\in G$, set $y=\phi(x)$. We have $x^{|G|} = e_G$, and additionally $y^{|G_1|} = e_{G_1}$, by a simple form of Lagrange. Applying $\phi$ to the first equation, we have $y^{|G|} = y^{|G_1|} = e_{G_1}$.
Since $|G|$ and $|G_1|$ are relatively prime, there are integers $a,b$ such that $a|G| + b|G_1| = 1$. Then $y = y^{a|G| + b|G_1|} = (y^{|G|})^a (y^{|G_1|})^b = e_{G_1}^a e_{G_1}^b = e_{G_1}$, i.e. $x\in\ker\phi$.