Here is the generalization that Robin pointed out in his answer: If $(|G|, s) = 1$, then the map given by
$$h \mapsto h^s$$
is a bijection. Although the argument presented by OP is quite slick, I couldn't apply it directly in this case. Here’s an alternative approach that works:
If $h_1^s = h_2^s$, then it follows that $|\langle h_1^s \rangle| = |\langle h_2^s \rangle| =: k$. Moreover, since $(|G|, s) = 1$, both subgroups $\langle h_1 \rangle$ and $\langle h_2\rangle$ have the same order $k$. Note that we immediately have from the observations above that $\langle h_1 \rangle = \langle h_2 \rangle$. Indeed, $\langle h_1 \rangle \cap \langle h_2 \rangle \subset \langle h_1 \rangle, \langle h_2 \rangle$ and contains an element of order $k$. Consequently, there exists some integer $t$ such that $0 < t < k$ and $h_1 = h_2^t$. Given that $h_1^{s} = h_2^{s}$ and their order is $k$, we have
$$(h_2^{s})^{t} = h_1^{s} = h_2^{s}.$$
Thus, $t \equiv 1\operatorname{mod}\,k$, which yields $t = 1$.
There is also a converse. If $ (\lvert G \rvert, s) \neq 1 $, we can choose a prime $ p $ such that $p | |G|$ and $p | s$. By Cauchy's Theorem, there exists an element $ g \in G $ with order $ p $. Therefore, the function $h \mapsto h^{s}$ is not injective, as $g$ is mapped to $1$.
solution-verificationquestion to be on topic you must specify precisely which step in the proof you question, and why so. This site is not meant to be used as a proof checking machine. – Bill Dubuque Aug 17 '24 at 06:22