[guided]We need two algebraic rules for powers of one fixed group element. The first says that multiplying powers adds exponents, and the second says that taking inverses negates exponents.
The power notation is defined in the theorem statement as follows. We set $g^0=e$. If $n \in \mathbb{N}$, then $g^n$ denotes the product of $n$ copies of $g$, associated in any fixed way; associativity of the group operation ensures that the value is independent of parenthesisation. If $n<0$, then $g^n$ means $(g^{-1})^{-n}$, where $-n \in \mathbb{N}$. Here $\mathbb{N}=\{1,2,3,\dots\}$, as specified in the statement.
For positive exponents, associativity gives
\begin{align*}
g^a g^b = g^{a+b}
\end{align*}
whenever $a,b \in \mathbb{N}$. If one exponent is $0$, the identity law gives the same formula because $g^0=e$. If negative exponents occur, write $a=a_+-a_-$ and $b=b_+-b_-$ with $a_+,a_-,b_+,b_- \in \mathbb{N}\cup\{0\}$ chosen so that $g^a$ is a product of $a_+$ copies of $g$ followed, if $a_- >0$, by $a_-$ copies of $g^{-1}$, and similarly for $g^b$. Associativity permits us to remove adjacent pairs $gg^{-1}$ and $g^{-1}g$, each of which equals $e$. The number of uncancelled copies of $g$ minus the number of uncancelled copies of $g^{-1}$ is exactly $a+b$, so the remaining product is $g^{a+b}$ by the definition of integer powers. Thus, for all $a,b \in \mathbb{Z}$,
\begin{align*}
g^a g^b = g^{a+b}.
\end{align*}
Now take $b=-a$. The exponent law gives
\begin{align*}
g^a g^{-a}=g^0=e
\end{align*}
and also
\begin{align*}
g^{-a} g^a=g^0=e.
\end{align*}
By the uniqueness of inverses in a group, this means
\begin{align*}
(g^a)^{-1}=g^{-a}.
\end{align*}[/guided]