I have trouble with the exercise mentioned:
Let $S$ be a scheme, let $X$ be a reduced scheme over $S$, and let $Y$ be a separated scheme over $S$. Let $f$ and $g$ be two $S$-morphisms of $X$ to $Y$ which agree on an open dense subset of $X$. Show that $f = g$. Give examples to show that this result fails if either (a) $X$ is non-reduced, or (b) $Y$ is non-separated. [Hint: Consider the map $h : X \rightarrow Y \times_S Y$ obtained from $f$ and $g$.]
I can solve the problem in case ``agree on an open dense subset of $X$'', say $U$, means that $f|_U = g|_U$ as morphisms i.e. not only do the continuous maps agree but the sheaf parts also agree and I don't seem to need the assumption that $X$ is reduced. I guess the problem only means the continuous maps agree. In that case, how does one make use of the assumption that $X$ is reduced to solve the problem?
I have tried many examples and it seems that when $X$ is reduced, the only open dense set is the whole space $X$ in which case there is nothing to do. But I don't think this is true in general.