Why are epimorphisms in the category of Monoids not necessarily surjections?
Let $\Bbb Z$ be the additive group of integers, and $\Bbb N_0=\{0,1,2,\ldots\}$. Then the inclusion $\Bbb N_0\to\Bbb Z$ is an epimorphism in Mon.
Quoting Wikipedia, we see:
In the category of monoids, Mon, the inclusion map $\mathbb{N}\to\mathbb{Z}$ is a non-surjective epimorphism. To see this, suppose that $g_1$ and $g_2$ are two distinct maps from $\mathbb{Z}$ to some monoid $M$. Then for some $n\in\mathbb{Z}$, $g_1(n)\neq g_2(n)$, so $g_1(-n)\neq g_2(-n)$. Either $n$ or $-n$ is in $\mathbb{N}$,, so the restrictions of $g_1$ and $g_2$ to $\mathbb{N}$ are unequal.
Actually, the situation in the other answers are all instances of a more general phenomenon: If $\mathbb M_A$ is the free monoid generated by a set $A$, and $\mathbb F_A$ is the free group generated by the same set, then the inclusion map $\mathbb M_A \hookrightarrow \mathbb F_A$ is epic! To see why, observe that the image of a monoid homomorphism $h : \mathbb F_A \to M$ is always a group. By the universal property of the free group construction, then, $h$ is determined by its values at the elements of $A$. Given any two homomorphisms $h, g : \mathbb F_A \to M$ that agree on $\mathbb M_A$, since they must also agree on $A$, $h = g$.