To prove in a Group Left identity and left inverse implies right identity and right inverse

Let $G$ be a nonempty set closed under an associative product, which in addition satisfies :

A. There exists an $e$ in $G$ such that $a \cdot e=a$ for all $a \in G$.

B. Given $a \in G$, there exists an element $y(a) \in G$ such that $a \cdot y(a) =e$.

Prove that $G$ must be a group under this product.

Attempt -Since Associativity is given and Closure also, also the right identity and right inverse is given .So i just have to prove left identity and left inverse.

Now as $ae=a$ post multiplying by a, $aea=aa$. Now pre multiply by a^{-1} I get hence $ea=a$. And doing same process for inverse Is this Right?


Let, $ab=e\land bc=e\tag {1}$ for some $b,c\in G$. And, $ae=a\tag{2}$ From $(2)$, $$eae=ea\implies(ab)a(bc)=ea\implies ((ab)(ab))c=ea\implies ec=ea\tag{3}$$

Similarly, $$ae=a\implies a(bc)=a\implies (ab)c=a\implies ec=a\tag{4}$$

$(3)$ and $(4)$ implies, $$ea=a$$

Also from $(3)$ and $(1)$, $$(bab)(bca)=e\implies b((ab)(bc)a)=e\implies ba=e$$