I'm starting a course on algebraic structures in university, and this is one of the first problems. I want to know if my solution is valid. The question goes like this:
Being $G$ non-empty semigroup (set with associative binary product). We know that $G$ verifies that:
- $\exists e\in G:ex=x \forall x\in G$ ("left" neutral element).
- $\forall x \in G, \exists y\in G : yx=e$ ("left" inverse element).
Prove that $G$ is group.
My solution goes like this: $$e=ee=(g^{-1}g)e=g^{-1}(ge)$$ Then necessarily $ge=g$, because $g^{-1}(ge)$ must be equal to $e$. So that proves that $e$ is in fact left and right neutral element of $G$.
Now, we see that: $$g=ge=g(g^{-1}g)=(gg^{-1})g$$ and we conclude that $gg^{-1}=e$ because $(gg^{-1})g$ must be equal to $g$, so we conclude that $g^{-1}$ is left and right inverse element of $g$.
Given this, I conclude that $G$ is in fact group.
Is my reasoning correct? I'll thank any help.