Example of a monoid with two distinct left inverses I read this statement: 

In a monoid, if an element has two distinct left inverses, it cannot
  have a right inverse, and hence cannot have a two-sided inverse.

I'm wondering if there's an easy example that I could use to illustrate this fact. 
 A: Let $M$ be the set of functions from $\mathbb{Z}_{\geq 0}$ to itself, which is a monoid under composition. Take $f(n) = n+1$. Then for each element $a\in\mathbb{Z}_{\geq 0}$, the function
$$
g_a(n):=\begin{cases} n-1&:n\geq 1,\\a&:n=0,\end{cases}
$$
is a left inverse of $f$. It is easy to see directly $f$ cannot have a two-sided inverse because it is not surjective.
A: For a set $S$, let $M(S)$ be the monoid of all maps $S \to S$ under composition. If $S$ is infinite then there are maps that are injective but not surjective, and they have infinitely many left inverses but no right inverse. Similarly, maps that are surjective but not injective have infinitely many right inverses but no left inverse.
A: Let $M$ be the monoid of all functions from $\mathbb{R}$ to $\mathbb{R}$, with the operation of composition.

Consider the functions $f,g,h \in M$ defined by
\begin{align*}
f(x) &= e^x\\[4pt]
g(x) &= 
\begin{cases}
\ln{x}&\text{if}\;x > 0\\[4pt]
0&\text{otherwise}\\[4pt]
\end{cases}\\[4pt]
h(x) &= 
\begin{cases}
\ln{x}&\text{if}\;x > 0\\[4pt]
1&\text{otherwise}\\[4pt]
\end{cases}
\end{align*}
Then $g,h$ are left inverses of $f$ in $M$, but $f$ has no right inverse in $M$. 
