Further Question on Showing Split SES The question is as follows:

Let $1 \to H \to G \to K \to 1$ be a short exact sequence of groups such that $K$ is a cyclic group of order $n$ and $H$ is a group of order $m$. Prove that if $n$ and $m$ are relatively prime, then the exact sequence is split.

The answer in this post Showing an exact sequence of groups is split. suggested the following:
Denote $f:G\to K$ to be the homomorphism in the sequence. Since $K$ is cyclic of order $n$, then there is $K = \left<x\right>$ for some $x$ of order $n$. There is an element $y$ such that $f(y) =x$. We then define the retraction as generated by $t:x\mapsto y^m$. I am confused on the construction because as far as I can see, we have $ft(x) = f(y^m) = f(y)^m = x^m$. However, how is this related to the original $x$? Shouldn't we be looking for some element such that $ft = \mathbf{id}_K$? I might be missing something at the last step here...
 A: First, if we were to have a retract $ft=\operatorname{id}_K$, then $t(x)$ would need to have order $n$ in $G$. Gut instinct says we need to find an element of order $n$ in $G$, generating a subgroup of $G$ isomorphic to $K$, which maps back onto $K$ via $f$.
By surjectivity, we can find $y\in G$ such that $f(y)=x$. Note this means $f(y)$ has order $n$. Also, $1=x^n=f(y^n)$, so $y^n\in\ker f=H$ (assuming $H\to G$ is the injection, for simplicity). Since $H$ has order $m$, we find $(y^n)^m=1$, so $(y^m)^n=1$, or $y^m$ has order dividing $n$. This is enough to proceed, but just to delve further, if $(y^m)^k=1$ for some $k\geq 1$, then we see $1=f(y^m)^k=f(y)^{km}$, and since $f(y)$ has order $n$, one gets $n\mid km$. Since $n$ and $m$ are coprime, $n\mid k$, and so $y^m$ actually has order $n$. This makes it seem like the right candidate for our desired element.
We again have
$$
\operatorname{ord}(f(y^m))=\operatorname{ord}(f(y)^m)=\operatorname{ord}{f(y)}/\gcd(m,n)=\operatorname{ord}f(y)=n
$$
so again $f(y^m)$ is a generator of $K$, denote it by $\sigma:=f(y^m)$. Since $y^m$ has order $n$ in $G$, we can define a group morphism retract $t\colon K\to G:\sigma\mapsto y^m$ and extend homomorphically. Then
$$
ft(\sigma)=f(y^m)=\sigma
$$
so $ft=\operatorname{id}_K$, as it fixes the generator $\sigma$.
