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.