TITLE: Examples of canonical projections that are not epimorphisms and canonical injections that are not
QUESTION [8 upvotes]: Although in $\mathsf{Set}$, canonical projections from a product are surjective and canonical injections to a coproduct are in fact injections, there seems to be nothing forcing this to be the case elsewhere, and indeed Wikipedia indicates without proof that they needn't be epic/monic. Unfortunately, I'm a rank beginner and have not yet knowingly read about a category less rich in monomorphisms and epimorphisms than $\mathsf{Set}$ (though Aluffi has already introduced a couple examples that are richer in them), so I don't know where to try to find a counterexample. Any hints?
To clarify: I am seeking canonical injections to coproducts that are not monomorphisms and/or canonical projections from products that are not epimorphisms.

REPLY [9 votes]: Take a category that looks like this: $X \leftarrow P \rightarrow Y \rightrightarrows Z$. It has four objects, $X,Y,Z,P$, the only nonidentity morphisms are the ones I indicated (there are four), and the two composites $P \to Y \to Z$ which are the same. $P$ is clearly the product of $X$ and $Y$. But the projection $P \to Y$ is not an epimorphism.
The opposite of this category gives a counterexample for injection.