TITLE: give a counterexample of monoid
QUESTION [13 upvotes]: If $G$ is a monoid, $e$ is its identity, if $ab=e$ and $ac=e$, can you give me a counterexample such that $b\neq c$? 
If not, please prove $b=c$.
Thanks a lot.

REPLY [2 votes]: For anyone interested, here are a couple more examples, followed by some special cases for which this property is true.
Examples

Let $T$ be the monoid of functions on $\mathbb{N}$, under composition.  Let $b(x) = 2x$, $c(x) = 2x+1$, and $a(x) = \lfloor x / 2 \rfloor$.  We have $a(b(x)) = x$ and $a(c(x)) = x$ but $b \ne c$.
Let $X$ be the set of $\mathcal{C}^\infty$ functions on $[0,1]$, and let $L$ be the monoid of linear operators on $X$.
(In fact, $L$ is a ring.)
Let $A(f) = \frac{df}{dx}$, $B(f) = \int_0^x f(t) \; dt$, and $C(f) = f(0) + \int_0^x f(t) \; dt$.  Again $A \circ B = A \circ C = \text{id}$, but $B \ne C$.

Special Cases

Suppose $M$ is finite.  Then $ab = ac = e$ implies $b = c$.
Proof. $M$ naturally embeds in the monoid $T$ of functions on $M$ via $a \mapsto f_a$, where $f_a(x) = ax$.  (See also.)  $T$ is finite.  If $ab = ac = e$ then $f_a$ is surjective, hence injective, hence its inverse is unique.
Suppose $M$ is commutative.  Then $ab = ac = e$ implies $b = c$.
Proof. $b = abc = c$.