Is a semigroup with left identity und unique left inverse a group?

Let $$(G, \cdot)$$ be a semigroup (i.e. a set with an associative binary operation) and fix some $$e\in G$$. If

1) $$\forall g\in G: e\cdot g=g$$ (left identity),

2) $$\forall g\in G~ \exists g^{-1}\in G: g\cdot g^{-1}=e$$ (right inverse),

3) $$\forall g,h\in G: g\cdot h=e\Rightarrow h=g^{-1}, h\cdot g^{-1}=e\Rightarrow h=g$$ (unique inverse),

must $$(G, \cdot)$$ be a group? I know that a left idenitity and right inverse don't necessarily give a group, and that a unique left identity and unique right inverse give a group. Yet this question I have no clue how to attempt.

• Axiom 2-3 is awkwardly written, since right inverse is not unique. If 2 is existence of a right inverse, then it has no reason to be written $g^{-1}$. If you mean you fix such a function, it should be part of the axiom: you have a function $g\mapsto g^{-1}$ satisfying axioms 2,3. – YCor Mar 11 '19 at 17:44

Let $$G$$ be any set with more than one element and call one of the elements $$e$$. Define a multiplication on $$G$$ by $$x\cdot y = y$$. This is associative, since $$x\cdot(y\cdot z) = (x\cdot y)\cdot z = z$$. For all $$x\in G$$ we have $$e\cdot x = x$$, so $$e$$ is a left identity (as is every other element of $$G$$). Also, $$x\cdot y = e$$ if and only if $$y = e$$, so each $$x$$ has a unique right inverse, namely $$e$$. But $$(G,\cdot)$$ is not a group, since there is no right identity.
EDIT: Looking closely at your axiom $$3$$, you seem to be requiring something more than unique right inverses. It seems that you also want an element to be the right inverse of at most one element; equivalently, if an element has a left inverse, it must be unique. In this case, $$(G, \cdot)$$ must indeed be a group.
To prove this, it suffices to show that a right inverse is also a left inverse. Choose any $$x\in G$$ and consider the product $$x'\cdot x\cdot x'\cdot x''$$, where $$x'$$ denotes a right inverse. On the one hand, $$x'\cdot (x\cdot x')\cdot x'' = x'\cdot e \cdot x'' = x'\cdot x'' = e.$$ On the other, $$x'\cdot x\cdot (x'\cdot x'') = x'\cdot x\cdot e$$, which must also be $$e$$. Since the right inverse of $$x'$$ is unique, $$x'' = x\cdot e$$. It follows that $$x''\cdot x' = (x\cdot e)\cdot x'= x\cdot(e\cdot x') = x\cdot x' = e.$$ Hence $$x'$$ is a right inverse for both $$x$$ and $$x''$$, so $$x = x''$$. Finally, $$x'\cdot x = x'\cdot x'' = e$$, so the right inverse of $$x$$ is also its left inverse.