Morphisms of $k$-schemes who agree on $\overline{k}$-points. Let $k$ be a field and $X,Y$ be two finite-type $k$ schemes such that $X$ is geometrically reduced.
Let $f,g : X \to Y$ be two morphisms of $k$-schemes such that the induced morphisms : $X(\overline{k}) \to Y(\overline{k})$ are equal. How does one show that $f = g$. There is a hint saying that one can reduce this to the case where $X$ is affine and $Y = \mathbb{A}^1_k$ and $k = \overline{k}$.
I have't been able to prove the hint nor the result assuming the hint so I would be very grateful for help or a reference. (this isn't homework)
Also I would like to know what goes wrong with this when $X$ isn't geometrically reduced.
 A: Since $f=g$ iff $f_{\overline{k}}=g_{\overline{k}}$ after base change, we may assume that $k=\overline{k}$. This means that $k$ is algebraiically closed and that $f,g : X \to Y$ agree on all rational i.e. closed points. These are dense. It follows that the underlying maps of $f$ and $g$ agree, if $X$ is separated (I think we need this assumption). We are left to show that the sheaf homomorphisms $f^\#,g^\#$ are equal, i.e. that $f^\#(s)=g^\#(s)$ for all local sections $s \in \mathcal{O}_Y(V)$. By viewing $s$ as a morphism $V \to \mathbb{A}^1$ and making a base change to $\mathbb{A}^1$, we may assume that $Y=\mathbb{A}^1$. Thus, we have to prove:
If $X$ is a reduced finite type $k$-scheme and $s,t$ are global sections of $X$ such that $s(x)=t(x) \in k$ for all $x \in X(k)$, then $s=t$. By considering $s-t$ we may assume $t=0$. By working locally we may assume that $X$ is affine, say $X=\mathrm{Spec}(A)$. Then $s \in A$ is an element which is contained in all maximal ideals of $A$, i.e. in all prime ideals of $A$ (since $A$ is jacobson). Since $A$ is reduced, we get $s=0$.
A: Here is an example showing why "geometrically reduced" is necessary for the result to hold. 
Let $k$ be an algebraically closed field and consider the $k$-algebra of dual numbers $k[\epsilon]=k[T]/(T^2)$.
Let $X=Y=\operatorname {Spec}(k[\epsilon ])$ and consider the two $k$-morphisms $f=Id, g:X\to X$ corresponding to the $k$-algebra morphisms $\phi=Id, \gamma:k[\epsilon]\to k[\epsilon]$ where   $Id(\epsilon)=(\epsilon)$ and$\gamma(\epsilon)=0$.
The morphisms $f=Id, g$ are different since $\phi=Id, \gamma$ are different.
Nevertheless the induced morphisms $f(k)=Id(k),g(k):X(k)=k\to X(k)=k$ are both equal to the identity of $k$.
