Surjective map on coordinate rings implies the map is injective Let $X$ and $Y$ be affine varieties and $f: X \rightarrow Y$ a polynomial map. If the induced map on coordinate rings $K[Y] \rightarrow K[X]$ is surjective why this implies that $f$ is injective?
 A: If $x\neq x'\in X$, then there exists $\phi\in K[X]$  with $\phi(x)=0$ and $\phi(x')=1$.
Let $\phi= f^\ast \psi=\psi\circ f$ for some $\psi \in K[Y] $ (surjectivity hypothesis).
Then $\psi( f(x))=(f^\ast \psi)(x)=\phi(x)=0$  whereas $\psi( f(x'))=(f^\ast \psi)(x')=\phi(x')=1$, and of course the inequality  $\psi( f(x))\neq \psi( f(x')) $  forces $f(x)\neq f(x')$.  
Edit (answer to Heitor's question in comment)
If the ring morphism $f^\ast:K[Y] \rightarrow K[X]$ is surjective then the  morphism of varieties $f:X\to Y$ is closed and in particular $f(X)\subset Y$ is algebraic.
However just assuming that a morphism of affine varieties $g:X\to Y$ is injective does not guarantee that $g(X)$ is closed.
A simple counter-example is the open immersion $X=\mathbb A^1\setminus \{0\}\hookrightarrow Y=\mathbb A^1$ whose image $X$ is clearly not closed in $Y$. 
[Reminder: $X=\mathbb A^1\setminus \{0\}$ is affine with function ring equal to $K[T,T^{-1}]$.
More geometrically the variety $X$ is isomorphic to the affine hyperbola $xy=1$ in the plane $\mathbb A^2$]
A: I'll assume you understand the correspondence between maximal ideals of $K[X]$ and points of $X$. I'll also assume the base field $k$ is algebraically closed. Then, for every point $p$ of $X$, there is a unique $k$-algebra homomorphism $\epsilon_p : K[X] \to k$ corresponding to $p$. We compose this with the pullback map $f^* : K[Y] \to K[X]$ to $\epsilon_{f (p)} : K[Y] \to k$. Now, suppose $f (p) = f (p')$. Then $\epsilon_{f (p)} = \epsilon_{f (p')}$, but then that means $\epsilon_p \circ f^* = \epsilon_{p'} \circ f^*$, and hence, $\epsilon_p = \epsilon_{p'}$ if $f^*$ is surjective. But that implies $p = p'$, so $f$ is injective.
