Note: As slightly less cumbersome notation, I write $g'$ for the inverse of $g \in G$ rather than $g^{-1}$.
A short answer is that you practice with similar problems over time and eventually spot common tricks (approaches used once) or techniques (approaches used at least twice). Below is a longer answer.
We want to take $x \in G$ and somehow productively apply $\phi$ to it. Suppose we can write $x = ab$ for $a, b \in G$. Then we would have: $\phi(ab) = \phi(a)\phi(b)$. A dead end! In particular, it seems that we should be rigging up our $x$ in some way that uses $\phi$ of an element; this will be advantageous when we re-apply $\phi$ because we have the additional given of $\phi^2$ being the identity map on $G$.
New plan: Suppose for any $x \in G$ we can write $x = a\phi(b)$ for some $a,b \in G$. Let's apply $\phi$ to this:
$$\phi(a\phi(b)) = \phi(a)b$$
I don't see where to go from here; moreover, there are too many letters flying around. This is where the leap (?) perhaps takes place: what if, instead of $b$, we could rig this up using $a'$? In other words, suppose it were the case that any $x \in G$ can be expressed as $x = a\phi(a')$. On second thought, mixing $\phi$ and the inverse of $a$ seems more complicated than necessary; after all, this last idea is equivalent to $x = g'\phi(g)$ where we have set $g=a'$. At this point, we have the desired setup of $x = g'\phi(g)$, which means applying $\phi$ will yield:
$$\phi(g'\phi(g)) = \phi(g')\phi^2(g) = [\phi(g)]'g = (g'\phi(g))'$$
where the final equality involves an extra bit of noticing. This has the wonderful property that $\phi(x) = x'$, which, if true for every $x \in G$, is equivalent to $G$ being an abelian group. In particular, for any $x,y \in G$:
$$xy = \phi(x') \phi(y') = \phi(x'y') = \phi([yx]') = [yx]'' = yx$$
whence $G$ is abelian as desired.
My guess is that D&F include this final equivalence/proof (or assign it as an exercise) earlier in the book.
As a slight postscript, my response here does not actually show that every element can be written in the desired form. And that may be a good thing: Although we used some of the givens (e.g., properties of $\phi$ being an automorphism – at least a homomorphism) we never did bring in the finiteness of $G$. So, the proof that elements can be expressed in the desired form is likely to include that condition!