Morphism of varieties $f:X\rightarrow Y$ (Affine) Im trying to do an exercise from the book Algebraic Curves of Fulton (Exercise  $\:6.26^{*}$).
It says:
Let $f:X\rightarrow Y$ be a morphism of affine varieties. Show that $f(X)$ in dense in $Y$ if and only if the homomorphism $\tilde{f}:\Gamma(Y)\rightarrow\Gamma(X)$ is one-to-one.
 A: This is not true. The statement is that $f:\text{Spec}(B)\to\text{Spec}(A)$ is dominant (has dense image), if and only if $\ker(A\to B)$ is contained in $\text{nil}(A)$, the nilradical of $A$. Indeed, consider the map $\text{Spec}(k)\to\text{Spec}(k[x]/(x^2))$ coming from the quotient $k[x]/(x^2)\to k$.
Here's an outline:


*

*Show that the closure of the image of $\text{Spec}(B)\to\text{Spec}(A)$ is $V(\ker(A\to B))$. This should just be chasing definitions.

*Show that $V(I)=A$ if and only if $I\subseteq \text{nil}(A)$. This should also be apparent by definitions.


Let me know if you have trouble!
A: a) Suppose that $f(X)$ is dense in $Y$ and that $\tilde{f}(\phi)=0$.
Then $\phi \circ f=0\Rightarrow \phi=0\ {\rm on} f(X) \Rightarrow \phi=0$ where the last step follows since morphisms are continuous wrt. the Zariski topology.
b) Suppose $X\subset A^m, Y\subset A^n$ and $f(X)$ not dense in $Y$.
By definition there exists an open set $O\subset A^n$ with $O\cap Y\not=\emptyset$ and $O\cap f(X)=O\cap Y\cap f(X)=\emptyset$.
Since $\emptyset \not=O \not= A^n$ we can write $O=\{\phi_1\not=0\}\cup 
\cdots \cup \{\phi_s\not=0\}$ for a finite collection $\phi_i$ of polynomials.
Hence a polynomial $\phi$ exists with $\{\phi\not=0\}\cap Y\not=\emptyset$
and $\{\phi\not=0\}\cap f(X)=\emptyset$. Then $\phi\in \Gamma(Y), \phi\not=0$
and $\tilde{f}(\phi)=0$. Hence $\tilde{f}$ is not injective.
