Separated varieties and uniqueness of extension I would like to know if my solution to the following exercise is correct. If not, then I will be grateful for a correct argument. (I am working with varieties over an algebraically closed field, not schemes)
Exercise: Suppose that $f,g:X \to Y$ are two morphisms, where Y is separated. If $f$ and $g$ agree on some dense open subset $U \subset X$ then $f = g$.
My argument: Let $W = \{x \in X\:|\:f(x) = g(x)\}$. I know by assumption that $U \subset W$, and wish to show that $W = X$. Since $Y$ is separated, the graph of $f$ (call it $\Gamma_f$) is closed in $X \times Y$. So by continuity, the preimage $(\mathrm{id},g)^{-1}(\Gamma_f) = W$ is closed in $X$. But then $X = Cl_X(U) \subset Cl_X(W) = W \Rightarrow W = X$ as required.
 A: You proved correctly that $f=g$ as maps of the underlying spaces of $X, Y$. That they are equal as morphisms either follows from the definition in Kempf's book (I can't check) or has to be proved (used the fact the $O_X(U)$ is reduced). 
A: In response to the answer by QiL (it was too long for a comment):
Kempf's definition of a morphism is: a continuous map of the underlying topological spaces, $f:X\to Y$ such that regular functions on Y pull back to regular functions on X: for any $V\subset Y$ open, $r\in \mathcal{O}_Y(U)\Rightarrow f^{∗}r \in \mathcal{O}_X(f^{−1}(U))$.
So my understanding is that I need to add the following extra line:
Moreover, $f,g$ induce the same pullback on regular functions. Indeed, for any open $U \subset Y$ and any $r \in \mathcal{O}_Y(U)$, consider the pullbacks $f^{*}r, g^{*}r$ in $\mathcal{O}_X(f^{-1}(U)) = \mathcal{O}_X(g^{-1}(U))$. Both these regular functions take the same value in $k$ at every point of $f^{-1}(U)$. Since $\mathcal{O}_X(f^{-1}(U))$ is reduced (implying regular functions are determined by their values) it follows that $f^{*}r=g^{*}r$. Since $f,g$ are equal as functions, and induce the same pullback, they are equal as morphisms.
Finally, just to be clear: in Kempf's book, the structure sheaf $\mathcal{O}_X$ of a variety $X$ assigns, by definition, to every open set $U \subset X$, a $k$-algebra of functions $U \to k$. So it will always be reduced (have no nonzero nilpotents).
