I asked my professor and she gave a proof like this.
For all $a,b \in G$, $a(ba)=(ab)a$. Let $(ba)=y$, $(ab)=z$ and $a=x$. By the supposition, we get $ba=ab$.
However, I still don't understand how this would work as a proof. What if $y,z$ were not chosen in such a way? It seems like this will only work for certain choices of $z$ and $y$. Also, they both have to be a multiple of $a$. Please convince me that this is a valid proof. It seems to me that $y$ and $z$ are not completely arbitrary.
You assume that if $xy=zx$, then $y=z$. You're not proving this- it's taken for granted that this holds for any $x,y,z$. In other words, they are arbitrary. What you want to show is that for any $a,b$, $ab=ba$ which is what the proof your professor provided shows.