TITLE: What are the epimorphisms and monomorphisms in the category of affine varieties?
QUESTION [8 upvotes]: I have a naive question on algebraic geometry.
To fix a context we consider $\phi:X\to Y$ a morphism between two affine varieties over an algebraic closed field $k$.
This give under the anti-equivalence of categories a k-algebra morphism $\phi^*$ between coordinate algebras of $Y$ and $X$.
However, $\phi^*$ injective doesn't imply $\phi$ surjective. Think for example to the projection of the hyperbola $XY=1$ to the $X$-axis.
Shouldn't the anti-equivalence of categories force a correspondence between injective and surjective morphisms?
It must be that surjective morphism of affine varieties are not the epimorphisms in the categorical sense, but I don't understand why?
I know that for finite morphisms for instance, we have this correspondence.
So I am wondering what are the epimorphisms and monomorphisms in the category of affine varieties?
Thanks in advance!
Regards,
Moustik

REPLY [4 votes]: I am posting my comment as an answer as requested, with some more concrete references.
We start with monomorphisms:
Proposition [Borceux, Ex. 1.7.7.d]. A homomorphism of unital commutative rings is a monomorphism if and only if it is injective.
Epimorphisms are harder to describe; see this MathOverflow question, and especially David Rydh's answer, which states a characterization of monomorphisms among morphisms of schemes which are locally of finite type.
We state a general characterization of epimorphisms of rings:
Theorem [Roby, Thm. 1]. Let $f \colon R \to S$ be a homomorphism of unital commutative rings. The following are equivalent:

$f$ is an epimorphism;
For every $R$-algebra $T$, there exists at most one $R$-algebra homomorphism $S \to T$;
For all $s \in S$, the relation $1 \otimes s = s \otimes 1$ holds in $S \otimes_R S$;
The multiplication map $\mu \colon S \otimes_R S \to S$ is injective (in which case it is an isomorphism of $R$-algebras);
The canonical injection $i_1 \colon S \to S \otimes_R S$ (resp. $i_2 \colon S \to S \otimes_R S$) defined by $s \mapsto s \otimes 1$ (resp. $s \mapsto 1 \otimes s$) is surjective (in which case it is an isomorphism of $R$-algebras);
The tensor algebra $T_R(S)$ is commutative;
$S \otimes_R S/R = 0$.

I've skipped some of the conditions; see [Roby] for more. Roby's article is from a seminar directed by Samuel, which is probably the most thorough source on epimorphisms of rings. Finally, see [Lazard] for results on flat epimorphisms, and [Stacks, Tag 04VM] for a modern reference.