I think this will work.

Let \(\displaystyle a,b \in G\).

If \(\displaystyle a=b,\) then \(\displaystyle ab=ba\).

If \(\displaystyle a=b^{-1},\) then \(\displaystyle ab=ba=e\).

So suppose that the two aren't equal and inverses of each other. Then \(\displaystyle ab\) is an element that is not equal to \(\displaystyle e,a,\) or \(\displaystyle b\). This goes for \(\displaystyle ba\) as well.

Now suppose that \(\displaystyle ab \not= ba\). Then we have

\(\displaystyle G=\{e,a,b,ab,ba \},\)

which means that \(\displaystyle a^{-1},b^{-1} \in \{ab,ba\}.\) If \(\displaystyle a^{-1}=ab\) and \(\displaystyle b^{-1}=ba,\) then

\(\displaystyle a^2b=e \Longrightarrow a^2=ba \Longrightarrow a=b,\)

which is a contradiction. The case for \(\displaystyle a^{-1}=ba, \, b^{-1}=ab\) is similar.