Let $G$ be a set with associative binary operation and a unit. Assume that for every $g\in G$ there exists $x \in G$ with $gx = 1$. Prove that $xg = 1$ is a consequence.
The statement is that every $g \in G$ has a right inverse $x$, ie, $gx = 1$. Now the same statement holds in turn for $x$: let $g'$ (suggestively named) be a right inverse for $x$, so that $xg' = 1$. Then on the one hand, using associativity $gxg' = (gx)g'= 1\cdot g' = g'$, but on the other hand, $gxg' = g(xg') = g\cdot 1 = g$. So $g = g'$, and $x g = x g' = 1$.
An equivalent conceptual way of thinking of this is as follows: The statement that $x$ is a right inverse of $g$ is identical to the statement that $g$ is a left inverse of $x$. So $x$ has a left inverse, and is assumed as always to have a right inverse. Therefore it must simply have a two-sided inverse.
1.- Try to prove that $y\in G\,,\,yy=y\Longrightarrow y=1$
2.- Now prove, using your notation, that $xg\cdot xg=xg$