Do these very weak axioms define a group? (Every element has left identity + left inverse or right identity + right inverse) In the discussion of this question users WillG and Yakk ask whether the following conditions define a group:

Let $A$ be a set and $*$ be a binary operation on $A$ satisfying:

*

*$*$ is associative.

*There exists an $e\in A$ such that for all $a\in A$, either (1) $e*a=a$ and there exists an $a'\in A$ such that $a'*a=e$, or (2) $a*e=a$ and there exists an $a'\in A$ such that $a*a'=e$.


I created this question to track the answer separately.
 A: Yes, these axioms are enough to define a group
Let $a \in A$ be a "left" element, so that $ea = a$ and $a' a = e$ for some $a' \in A$. We need to show $a a' = e$. Once this is done, the proof applies to "right" elements $a$ as well by symmetry, and we have shown that every element has a two-sided inverse. Since there is a superweak identity $e$, the claim then follows from this answer.
We will prove this by casework.
Case 1: $a'$ is a left element
In this case we have $a'' \in A$ with $a'' a' = e$, and $e a' = a'$. So we have $a = e a = (a'' a') a = a'' (a' a) = a'' e$. This means that $a a' = (a'' e) a' = a'' (e a') = a'' a' = e$, which we wanted to show.
Case 2: $a'$ is a right element
In this case, we only learn that $a' e = a'$. Define $b := a a'$, we need to show $b = e$.
Case 2.1: $b$ is a left element
Note that $eb = b$ and take $c \in A$ with $cb = e$. Note that $a = e a = (cb) a = c (ba) = c (a a' a) = c a e$, which implies that $ae = (c a e) e = c a e = a$. Thus, we have $b^2 = (a a') (a a') = a (a' a) a' = a e a' = a a' = b$. Apply $c$ on the left to yield $e b = e$ and thus $b = e$.
Case 2.2: $b$ is a right element
This is the same proof as case 2.1 mirrored, but I will spell it out to convince you and myself.
Note that $be = b$ and take $c \in A$ with $bc = e$. Note that $a' = a' e = a' (bc) = (a' b) c = (a' a a') c = e a' c$, which implies that $e a' = e ( e a' c) = e a' c = a'$. Thus, we have again $b^2 = (a a') (a a') = a (a' a) a' = a e a' = a a' = b$. Apply $c$ on the right to yield $b e = e$ and thus $b = e$.
