Let $a, b$ be elements in a monoid such that $ab$ has an inverse. Is it true that $a$ and $b$ have inverses? Prove this if true or give a counterexample if false.
I believe this is false because let $c$ be the inverse of $ab$. Then we have $abc = cab = e$. So we have $a(bc) = (ca)b = e$. So $a$ has a right inverse and $b$ has a left inverse. However, this does not imply that $a$ also has a left inverse and $b$ also has a right inverse because it is not necessarily an abelian monoid. I cannot find a counterexample though. Can anyone help?