Prove that $(G, \circ)$ is a group if $a\circ x = b$ and $x\circ a = b$ have unique solutions I have some difficulties with a task in algebra. I guess it's trivial and really easy but I can't figure out how to solve it.
I have a set $G$ and a binary operation on it, let it be $\circ$. I have that the operation is associative and that the equations $a\circ x = b$ and $x\circ a = b$ have unique solutions. I have to prove that $(G, \circ)$ is a group.
I already have that the operation is binary and associative, so I have to prove that there is unique identity element and unique inverse element and it will come from the equations, but how exactly?
 A: Let $g\in G$. By hypothesis, you know that the equation $gx=g$ has a unique solution and $xg=g$ has a unique solution. What can you say about these two soltuions? Let $x_0$ be the solution of the first equation. By hypothesis, the equations $gx=x_0$ and $xg=x_0$ have unique solutions. What can you say about these two solutions?
A: It is a bit subtle to prove the existence of an identity element.  For each $g \in G$, there exist unique elements $l_g, r_g$ (left/right identities for $g$) such that $l_g g = g$ and $g r_g = g$.  The goal is to show that $l_g = r_g = l_{g'} = r_{g'}$ for any two $g, g' \in G$.
You have $g l_g g = g^2$ and since the equation $x g = g^2$ has a unique solution, we have $g l_g = g$.  Thus, using uniqueness again, $l_g = r_g$.  Let's call this element $e_g$, which has the property that $e_g g = g e_g = g$.
Now we must show that $e_g = e_{g'}$ for $g, g' \in G$.  We have $g e_g g' = g g' = g e_{g'} g'$.  Since the equation $x g' = g g'$ has a unique solution, $g e_g = g e_{g'}$; similarly, since $g x = g e_{g}$ has a unique solution, $e_g = e_{g'}$.
A: Just for the heck of it, we can do it even without the uniqueness assumption.
Assumed: that multiplication is associative and that the equations $ax=b$ and $xa=b$ have at least one solution for all $a$ and $b$.


*

*If $e$ and $a$ are given such that $ea=a$, then $e$ is a left identify for every element.
Proof: Given $b$ let $x$ be such that $ax=b$. Then $eb=eax=ax=b$.

*Similarly, anything that is a right identity for something is a right identity for everything.

*If $l$ is a left identity for something and $r$ is a right identity for something, then $l=r$. 
Proof: By (1) and (2) $lr=l$ and $lr=r$.

*There is a unique identity element. Namely pick any element $a$ and let $e$ solve $ea=a$. Then by (3) the solution to $ax=a$ must equal this $e$, and then by (3) again, everything that is a right or left identity of something must be $e$.

*Uniqueness of inverses now follows by the usual argument: If $xa=ya=e$, then let $z$ be such that $az=e$ and then $x=xe=xaz=yaz=ye=y$ as well as $z=ez=xaz=xe=x$.

Come to think of it, this is actually a nicer characterization of groups than the usual mucking around with identities and inverses. A group is simply something with an associative operation such that everything can be made into anything else by multiplying it with something form the left or from the right, as we choose. Borrowing some terminology from graph theory we might call this a left-transitive and right-transitive associative operation. (Edit: It turns out this already has a name, though: Left simple semigroup and right simple semigroup -- and what the above proves is that groups are exactly those semigroups that are both left and right simple).
A: Hint
First, note that from  uniqueness of solutions it follows that the operation is cancellative: $ac=bc$ (as well as $ca=cb$) implies $a=b$.
The equation $ax = a$ has a solution $e$. Multiplying the identity $ae=a$ on the right by $a$ and then cancelling $a$ on the left we get $ea=a$, i.e. $e$ is an unity for $a$.
Multiplying and cancelling by other element $b$ we prove that  $e$ is an unity for all $G$. Next, from the equations $ax = e$ and $xa = e$ we obtain inverse elements...
