Suppose $X \to S$ and $Y \to S$ are schemes over $S$. Hartshorne's book defines an $S$-morphism from $X$ to $Y$ as a morphism $X \to Y$ compatible with the given morphisms to $S$.
I'm not 100% sure what this means.
My thoughts:
We have continuous maps $f: X \to Y$, $g: X \to S$, $h: Y \to S$ such that $g=hf$.
And we have maps $f^\#: \mathcal O_Y \to f_* \mathcal O_X$, $g^\#: \mathcal O_S \to g_*\mathcal O_X$, $h^\#: \mathcal O_S \to \mathcal h_* \mathcal O_Y$.
I would think we should have $g^\# = f^\# h^\#$, but this does not make sense.
What are the details of the datum of an $S$-morphism?
A $S$-morphism $f : X \to Y$ is a morphism of schemes $f : X \to Y$ such that $hf=g$. This says that $hf=g$ as continuous maps, and $g^\# : O_S \to g_\ast O_X$ is the same as $(h_\ast f^\#) \circ h^\# : O_S \to h_\ast O_Y \to \underset{g_\ast O_X}{\underbrace{f_\ast h_\ast O_X}}$