Do these “ultraweak” one-sided group axioms guarantee a group? This post shows that the “left” group axioms, which only guarantee a left-identity and left-inverses, are sufficient to guarantee that a semigroup is a group. The same idea could be used to show that the “right” group axioms are also sufficient. These sets of axioms might be considered “weak” group axioms, but I am curious whether we can get weaker. Consider the following “ultraweak” axioms:

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

*

*$*$ is associative.

*There exists an ultraweak identity element $e\in G$ such that for all $x\in G,$ either $e*x = x$ or $x*e=x$ (that is, the “sidedness” of $e$ may differ for each element of $G$).

*For all $x \in G$ there exists an ultraweak inverse $x^{-1}\in G$ such that either $x^{-1} * x = e$ or $x*x^{-1}=e$ (that is, each element of $G$ has at least a one-sided inverse, where the side may differ for each element).


Do these axioms guarantee that $(G,*)$ is a group? And if not, how much closer to these axioms can we get, starting from just the “weak” left or right axioms? [For example, maybe assuming an ultraweak identity element with left (or right) inverses is sufficient.]

REVISED UPDATE:
In the comments to the accepted answer by Vincent, @Yakk asks whether the following condition is sufficient to guarantee a group (assuming associativity of $*$):

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

At first I thought this was true due to the standard "left identity + left inverses" and "right identity + right inverses" cases applying element by element, but now I realize this reasoning is flawed (these proofs also require the one-sided inverse to have their own one-sided inverse with the same sidedness).
So the question remains: Does the above condition, proposed by @Yakk, guarantee a group? Please provide a proof or counterexample.

The answer to the revised update is “yes;” see here. There remains a further question about even weaker conditions, where the left and right identities can be different elements. I've asked that here.
 A: Consider any set $X$ equipped with the left projection operation $$*:(a,b)\mapsto a.$$ Associativity is trivial. Meanwhile, every element is a (right) identity: fixing $e\in X$ we have $x*e=x$ for all $x\in X$. Similarly, fixing $e\in X$ we can think of $e$ itself as the "ultraweak (left) inverse of $x$ with respect to $e$" - since it satisfies $e*x=e$.
So $Proj(X):=(X,*)$ satisfies a very strong version of the axioms you list. But as soon as $X$ has more than one element, $Proj(X)$ is very far from a group.

Re: the gap between this notion and full grouphood, note that crucially in the above we have a contrast between the ways the second and third axioms are satisfied - every element is a right identity, but we only have left inverses. The post linked in the OP meanwhile shows that if we demand right identity + right inverses, or left identity + left inverses, we do get full grouphood. So it's not so much that any single type of "sidedness" can vary from element to element, but rather that the relevant "sidednesses" are not required to be the same, which gives a weak notion.
A: What axioms are enough to guarantee a group?
Assuming associativity. "Two-sided inverses" only requires that there is a left inverse and a right inverse for every element, they don't have to be the same.




Identity \ Inverse
Two-sided
One-sided
Ultraweak




Two-sided
$\color{green}{\checkmark}$
$\color{green}{\checkmark}$
$\color{green}{\checkmark}$


One-sided
$\color{green}{\checkmark}$
Only if same side
$\color{red}{\mathcal{X}}$


Ultraweak
$\color{green}{\checkmark}$
$\color{red}{\mathcal{X}}$
$\color{red}{\mathcal{X}}$





*

*Left identity and left inverses: Enough $\color{green}{\checkmark}$

*Left identity and right inverses: Not enough (Noah's answer) $\color{red}{\mathcal{X}}$

*Ultraweak identity and two-sided inverses: Enough (See below) $\color{green}{\checkmark}$

*Two-sided identity and ultraweak inverses: Enough (See below) $\color{green}{\checkmark}$
In summary, once either the identities or the inverses are two-sided, we have a group. But if that is not the case, the only way to still guarantee a group is if the identity and inverses are both always on the same side.
Ultraweak identity and two-sided inverses are enough
We only require that there is a left inverse and a right inverse for every element, they don't have to be the same.
We show that $e$ is a left identity for every element. Since we have left inverses, the claim then follows from this answer. For an element $a$, the ultraweak identity yields $ea=a$ or $ae = a$. We only need to focus on the second case. $a$ has a right inverse $a'$, and $a'$ has a right inverse $a''$. Thus, $a = a e = a (a' a'') = (a a') a'' = e a''$. This shows that $ea = e(e a'') = e a'' = a$ as required.
Two-sided identity and ultraweak inverses are enough
Indeed, in this case $x^2=x$ implies $x=e$ for all $x$. Thus, if a has right-inverse $b$, we have $ab=e$ and thus $ba=b(ab)a=(ba)^2$, so that $ba=e$, therefore $b$ is also the left inverse.

Answer to REVISED UPDATE
I decided to track this in a seperate question. See this question and answer.
A: No, these are not sufficient. Consider the set of the two matrices
$$\begin{pmatrix}1&0\\0&0\end{pmatrix},\begin{pmatrix}1&1\\0&0\end{pmatrix}$$
with respect to matrix multiplication.
