TITLE: Counterexample Question
QUESTION [5 upvotes]: Let $f:X\rightarrow Y$ be a morphism of varieties. If $f(X)$ is dense in $Y$, then $\tilde{f}:\Gamma(Y)\rightarrow \Gamma(X)$ is injective, where $\tilde{f}$ is the homomorphism induced by $f$. In fact, if $X$ and $Y$ are affine,  then we have if and only if. Can we relax the prerequisites a bit and have $\tilde{f}$ injective $\Rightarrow$ $f(X)$ dense be true even if $Y$ is not affine? I'm inclined to say no, since I could only prove it using the fact that $Y$ is affine. But, this is not a proof that it's impossible. Are there any nice counterexamples out there?

REPLY [5 votes]: Take $X$ to be an embedding of a closed point into $Y=\mathbb P^1$. Then $\Gamma(Y)\to\Gamma(X)$ is an isomorphism.