[proofplan]
We compare the positive exponents that send $g$ to the identity in $G$ with the positive exponents that send $\varphi(g)$ to the identity in $H$. The power-preservation property of isomorphisms gives $\varphi(g^n)=\varphi(g)^n$, and injectivity of $\varphi$ then reflects equality with the identity. Hence the two exponent sets are equal, so they have the same least element when nonempty and are both empty otherwise.
[/proofplan]
[step:Define the two sets of identity exponents]
Define the set of positive identity exponents of $g$ by
\begin{align*}
A := \{n \in \mathbb{N} : g^n = 1_G\}.
\end{align*}
Define the set of positive identity exponents of $\varphi(g)$ by
\begin{align*}
B := \{n \in \mathbb{N} : \varphi(g)^n = 1_H\}.
\end{align*}
By definition of element order, $\operatorname{ord}(g)$ is the least element of $A$ if $A$ is nonempty and is $\infty$ if $A=\varnothing$. Likewise, $\operatorname{ord}(\varphi(g))$ is the least element of $B$ if $B$ is nonempty and is $\infty$ if $B=\varnothing$.
[/step]
[step:Show that an exponent kills $g$ exactly when it kills $\varphi(g)$]
We first record that $\varphi(1_G)=1_H$. Since $\varphi$ is a [group homomorphism](/page/Group%20Homomorphism),
\begin{align*}
\varphi(1_G)=\varphi(1_G1_G)=\varphi(1_G)\varphi(1_G).
\end{align*}
Multiplying on the left by $\varphi(1_G)^{-1}$ in $H$ gives $\varphi(1_G)=1_H$.
Let $n \in \mathbb{N}$. Since $\varphi$ is a [group isomorphism](/page/Group%20Isomorphism) and $g \in G$, [citetheorem:9502] applies and gives
\begin{align*}
\varphi(g^n)=\varphi(g)^n.
\end{align*}
If $n \in A$, then $g^n=1_G$, and therefore
\begin{align*}
\varphi(g)^n=\varphi(g^n)=\varphi(1_G)=1_H.
\end{align*}
Thus $n \in B$.
Conversely, if $n \in B$, then $\varphi(g)^n=1_H$. Using power preservation and $\varphi(1_G)=1_H$, we get
\begin{align*}
\varphi(g^n)=\varphi(g)^n=1_H=\varphi(1_G).
\end{align*}
Because $\varphi$ is an isomorphism, it is injective, so $g^n=1_G$. Hence $n \in A$. Therefore $A=B$.
[guided]
The goal is to compare the order of $g$ with the order of $\varphi(g)$. Since order is defined through positive powers becoming the identity, we fix a positive integer $n \in \mathbb{N}$ and prove that $g^n$ is the identity in $G$ exactly when $\varphi(g)^n$ is the identity in $H$.
First, we verify that $\varphi$ sends the identity of $G$ to the identity of $H$. Because $\varphi: G \to H$ is a group isomorphism, it is in particular a group homomorphism. Applying the homomorphism property to $1_G1_G$ gives
\begin{align*}
\varphi(1_G)=\varphi(1_G1_G)=\varphi(1_G)\varphi(1_G).
\end{align*}
The element $\varphi(1_G)$ lies in the group $H$, so it has an inverse in $H$. Multiplying the displayed equality on the left by $\varphi(1_G)^{-1}$ gives
\begin{align*}
1_H=\varphi(1_G).
\end{align*}
Now let $n \in \mathbb{N}$. The theorem [citetheorem:9502] applies because $G$ and $H$ are groups, $\varphi: G \to H$ is a group isomorphism, $g \in G$, and $n$ is an integer. Hence
\begin{align*}
\varphi(g^n)=\varphi(g)^n.
\end{align*}
Suppose first that $n \in A$. By definition of $A$, this means $g^n=1_G$. Applying $\varphi$ and using both power preservation and identity preservation, we obtain
\begin{align*}
\varphi(g)^n=\varphi(g^n)=\varphi(1_G)=1_H.
\end{align*}
Thus $n$ belongs to $B$.
Conversely, suppose that $n \in B$. By definition of $B$, this means $\varphi(g)^n=1_H$. Using power preservation again and using $\varphi(1_G)=1_H$, we have
\begin{align*}
\varphi(g^n)=\varphi(g)^n=1_H=\varphi(1_G).
\end{align*}
Here is where injectivity is essential: since $\varphi$ is an isomorphism, it is injective, so equality of the images forces equality of the original elements. Therefore $g^n=1_G$, which means $n \in A$.
We have proved both inclusions $A \subseteq B$ and $B \subseteq A$, so
\begin{align*}
A=B.
\end{align*}
[/guided]
[/step]
[step:Pass from equality of exponent sets to equality of orders]
Since $A=B$, the two sets are either both empty or both nonempty. If $A=B=\varnothing$, then no positive power of $g$ is $1_G$ and no positive power of $\varphi(g)$ is $1_H$, so
\begin{align*}
\operatorname{ord}(g)=\infty=\operatorname{ord}(\varphi(g)).
\end{align*}
If $A=B$ is nonempty, then the least positive exponent in $A$ equals the least positive exponent in $B$, and therefore
\begin{align*}
\operatorname{ord}(g)=\min A=\min B=\operatorname{ord}(\varphi(g)).
\end{align*}
This proves
\begin{align*}
\operatorname{ord}(\varphi(g))=\operatorname{ord}(g).
\end{align*}
[/step]