This is "left to the reader as an exercise" in Dummit and Foote's Abstract Algebra. Here's my attempt;
We need to prove two things; \begin{align} (i)&\ \text{If $a = \pm1$ then $H = \langle x^a \rangle$};\\ (ii)&\ \text{If $H = \langle x^a \rangle$ then $a = \pm 1$}. \end{align} The proof of $(i)$ is immediate since if $a = \pm 1$ then $H = \langle x^{\pm 1}\rangle = \langle x\rangle$, so we proceed straight to $(ii)$. If $H = \langle x^a\rangle$ and $a = k \neq \pm 1$ then we have that that \begin{align} H &= \lbrace (x^k)^n : n \in \Bbb Z\rbrace\\ & = \lbrace 1, x^k, x^{2k}, \ldots\rbrace. \end{align} $H$ was defined to be $H =\langle x \rangle$, while this misses out the elements $x^2,\ldots,x^{k-1}, x^{k+1}, \ldots, x^{2k-1}, \ldots$ and so $k$ must be equal to $1$.
I feel like the second part of this argument is extremely shoddy, or am I just paranoid? Grateful for any assistance.
I agree; the second part of the argument is ambiguous and doesn't explain why $x^2$ is missing from $H$. Here's a clearer argument:
Let $H=\langle x^a \rangle$. Since we are given $H=\langle x\rangle$, we have $x \in H$. Since $H=\langle x^a\rangle$, all $g \in H$ are in the form $x^{ak}$ for $k \in \Bbb{Z}$, so we get: $$x^{ak}=x \implies x^{ak-1}=1$$ Since $x$ has infinite order, the only we this can be is if $ak-1=0$, or $ak=1$, or $a \mid 1$, or $a=\pm 1$.