What is the definition of surjective morphism of schemes?
Solution 1:
1) The correct definition of "surjective" for a morphism of schemes $f:X\to Y $ is that the underlying map of sets $|f|:|X|\to |Y|$ be surjective.
"Correct" means "as decreed by Grothendieck" : Cf. EGAI, Chap. I, Prop 3.5.2 .
2) The categorical notion mentioned in your point (2) is called epimorphism.
3) If $\overline{f(X)} = Y$, we say that $f$ is dominant.
This is much weaker than surjectivity (even for reduced schemes), as witnessed by the inclusion of any dense open strict subset of a scheme, say $\mathbb A^1\setminus \{0\}\hookrightarrow \mathbb A^1$.
4) Surjective morphisms needn't be epimorphisms:
Let $k$ be a field and let $X=Spec(k)$, $Y=Spec(k[T]/(T^2))=k[\epsilon]$ be respectively the simple point and the double point over $k$.
Let $f:X\hookrightarrow Y$ be the closed immersion of the simple point into the double point corresponding to the $k$-algebra morphism $k[\epsilon]\to k$ sending $\epsilon$ to $0$.
The two $k$-algebra morphisms $k[\epsilon]\to k[\epsilon]$ sending $\epsilon$ to respectively $0$ and $\epsilon $ give rise to two morphisms $g_1, g_2:Y\to Y$ satisfying $g_1 \circ f=g_2 \circ f$ but $g_1 \neq g_2$.
Hence the scheme morphism $f:X\to Y$ is not an epimorphism although it is surjective, as are all maps between singleton sets.
5) Epimorphisms needn't be surjective (?):
Let $Y=\mathbb A^1_k$ (with $k$ an algebraically closed field) and $X$ be the discrete scheme obtained from the disjoint union (=coproduct) of all the closed points of $Y$.
The natural morphism $f:X\to Y$ has image $Y$ minus the generic point of $\mathbb A^1_k$ and is thus not surjective.
However it should be an epimorphism, but I haven't written out a proof of that.