If $\pi:C\to S$ is a section of an elliptic fibration $f:S\to C$, is $\pi$ a closed immersion? Let all varieties be smooth, projective over $\Bbb{C}$.
Let $S$ be a surface, $C$ a curve and $f:S\to C$ an elliptic fibration, in the sense of Schütt-Shioda's  Elliptic Surfaces [Chapter 3], i.e.
i) A general fiber of $f$ is an elliptic surface.
ii) $f$ is relatively minimal, i.e. no fibers contain an exceptional divisor in its support
iii) $f$ has a section, i.e. a morphism $\pi:C\to S$ with $f\circ\pi=\text{id}_C$.
My question is this: is $\pi$ a closed immersion?
Here's where I'm at: since $f\circ \pi=\text{id}_C$, in particular $\pi$ is injective. Moreover $S,C$ are projective, so $\pi(C)$ is closed in $S$. But I'm still not sure how I would prove that $\pi^*_P:\mathcal{O}_{S,\pi(P)}\to \mathcal{O}_{C,P}$ is surjective.
What should I do?
 A: Yes, $\pi$ is a closed immersion. It's probably most straightforward to develop some machinery and then set that loose on the problem:
Lemma 1. Suppose $f:X\to Y$ and $g:Y\to Z$ are two morphisms such that $g\circ f$ is separated. Then $f$ is separated.
Proof: We use the valuative criteria. Consider the following diagram:
$$\require{AMScd}
\begin{CD}
\operatorname{Spec} K @>>> X\\
@VVV @VVV \\
\operatorname{Spec} R @>>> Y\\
@. @VVV\\
@. Z 
\end{CD}$$
By the valuative criteria applied to the composite $\operatorname{Spec} R\to Y\to Z$, we find that there is at most one map $\operatorname{Spec} R\to X$ making the diagram commute, and we're done. $\blacksquare$
Lemma 2 (Hartshorne exercise II.4.8). Suppose $P$ is a property of morphisms of schemes so that a closed immersion has $P$, a composition of two morphisms having $P$ has $P$, and $P$ is stable under base extension. Then:

*

*A product of morphisms having property $P$ has property $P$;

*If $f:X\to Y$ and $g:Y\to Z$ are two morphisms such that $g\circ f$ has $P$ and $g$ is separated, then $f$ has $P$.

Proof:

*

*We work in the relative situation where all our schemes are over some base $S$. Suppose $X\to Y$ and $X'\to Y'$ are two morphisms of $S$-schemes each with property $P$. Consider the following diagram, where the squares are cartesian:

$$\require{AMScd}
\begin{CD}
X\times_S X' @>{P}>> X\times_S Y' @>{id}>> X\times_S Y' @>{P}>> Y\times_S Y' \\
@VVV @VVV @VVV @VVV\\
X' @>{P}>> Y' @. X @>{P}>> Y
\end{CD}$$
Both arrows in the bottom row have property $P$ by assumption, so the outside arrows in the top row have property $P$ because it's stable under base extension. As the identity is a closed immersion, that has property $P$ too, and we have the claim.


*Consider the graph morphism $\Gamma_f: X\to X\times_Z Y$, which is the base change of $\Delta_{Y/Z}:Y\to Y\times_Z Y$ along $f\times_Z id_Y: X\times_Z Y\to Y\times_Z Y$. As $g$ is separated, $\Delta_{Y/Z}$ is a closed immersion and therefore has property $P$. Since $\Gamma_f$ is the base change of $\Delta_{Y/Z}$, it also has property $P$. As $X\to Z$ and $id_Y:Y\to Y$ have property $P$, we have by (1) that $X\times_Z Y\to Z\times_Z Y$ has property $P$. But $Z\times_Z Y\cong Y$, and so the composition $X\stackrel{\Gamma_f}{\to} X\times_Z Y \to Z\times_Z Y \stackrel{\sim}{\to} Y$ has property $P$. $\blacksquare$
For your problem, we start by applying lemma 1 to see that $\pi$ is separated, since  the composite $S\to C\to \operatorname{Spec} \Bbb C$ is projective and thus separated. Now we may apply lemma 2 part (2) with $P$ being "is a closed immersion" to the morphisms $f$ and $\pi$ to see that $f$ is a closed immersion.
