Does closed immersion induce surjection of global section Let $X$ be a projective scheme and $Y \subset X$ be a projective subscheme. Assume $X, Y$ are connected. Denote by $i:Y \hookrightarrow X$ the closed immersion. Is it always true that the induced morphism $H^0(\mathcal{O}_X) \to H^0(i_*\mathcal{O}_Y)$ surjective?
 A: No. Let $X = P^1$ and $Y$ be a double point (locally given by the ideal $(x^2)$). Then $H^0(X,O_X) = k$ while $H^0(i_*O_Y) = k^2$.
A: If you are looking at varieties over an alg. closed field, the answer will be yes, since both $H^0$'s will just equal $k$.  But in general the answer is no.  Sasha gives a non-reduced example.  A reduced example is given by considering $Y  = V(X_0^2 + X_1^2) \hookrightarrow \mathbb P^1$, over $\mathbb Q$ (or any field that doesn't contain $\sqrt{-1}$).
A: Suppose $\mathcal{I}$ is the ideal sheaf of $\mathcal{O}_X$ that defines $Y$.That is, $i_*\mathcal{O}_Y=\mathcal{O}_X/\mathcal{I}$. Then we have a short exact sequence of sheaves
$$0\rightarrow\mathcal{I}\rightarrow\mathcal{O}_X\rightarrow i_*\mathcal{O}_Y\rightarrow0.$$
This gives us a long exact sequence of cohomology
$$0\rightarrow H^0(X,\mathcal{I})\rightarrow H^0(X,\mathcal{O}_X)\rightarrow H^0(X,i_*\mathcal{O}_Y)\rightarrow H^1(X,\mathcal{I})\rightarrow H^1(X,\mathcal{O}_X)\rightarrow\ldots.$$
Clearly, what you want is equivalent to the map $H^1(X,\mathcal{I})\rightarrow H^1(X,\mathcal{O}_X)$ being injective (thanks MB!), which is not necessarily true under the conditions you specified.
