It is not hard to see that if we have a semigroup epimorphism $\varphi\colon S\to T$, where $S$ is a group, then $T$ must be a group, and it is actually the quotient by the kernel, i.e. the set of $g\in S$ such that $\varphi(g)=\varphi(e)$
The natural argument for this does not seem to work if $S$ is merely a monoid. Namely, $\varphi$ is still constant on the cosets of the "kernel", but there seems to be no obvious reason for this to be an equivalent condition.
Are there some (natural?) examples when this is not true? In particular, is it possible for a (two-sided?) cancellative $S$? If not, what if $S$ is not a monoid (but merely a semigroup)?
Here's a very simple example. Let $S=\mathbb{N}$ and let $T=\{0,\infty\}$ with addition defined the obvious way. Then there is a homomorphism $\varphi:S\to T$ which sends $0$ to $0$ and every positive number to $\infty$. The kernel of $\varphi$ is trivial, but $\varphi$ is doing a lot more than just modding out the trivial submonoid!
For an example where both monoids are cancellative, let $S=\mathbb{N}^2$ and $T=\mathbb{N}$, and let $\varphi:S\to T$ be defined by $\varphi(a,b)=a+b$. Once again, the kernel of $\varphi$ is trivial but it is not the quotient by the trivial submonoid.