# Graph morphism for a separated morphism of schemes

I want to prove the following: Let $f: X \rightarrow S$ be a separated morphism of schemes. Show that any section $g: S \rightarrow X$ of $f$ i.e. a morphism such that $f \circ g=\textrm{id}_{S}$ is a closed immersion.

It seems that this can be done by considering an appropriate graph morphism. Here is what I have thus far:

Taking $X$ as an $S$-scheme under $f$, we have that a section of $f$ is simply $g: S \rightarrow X$. Let us consider $\Gamma_{g}:S \rightarrow S \times_{S} X$, which is a locally closed immersion, and a closed immersion since we have that $X$ is separated. Then $\Gamma_{g}$ is canonically identified with $g$ in this situation. Is that all that is required here?

-

Yes this works. A bit more detailed: If $T \to X$ is a morphism of $S$-schemes and $X$ is separated over $S$, then the graph morphism $T \to T \times_S X$ is a closed immersion since the following diagram is cartesian:
$$\begin{array}{c} T & \rightarrow & T \times_S X \\ \downarrow && \downarrow \\X & \rightarrow & X \times_S X \end{array}$$
Applying this to $T=S$, we get the desired result that every section of $X \to S$ is a closed immersion.