I am currently reading up on moduli stack of algebraic curves (https://www.math.uni-bonn.de/~schmitt/ModCurves/Script.pdf). On Page 54 in this script, they claim that giving a morphism $f: S \to \mathcal{M_{g,n}}$ is equivalent to giving a family $\pi: C\to S$ of curves over $S$.
However, I don't know how to show this equivalence and don't even know how to start a proof.
Any help is appreciated :)
This is essentially the Yoneda lemma. Every category $\pi\colon\mathcal{M}\to\mathbf{Sch}$ fibered in groupoids is equivalently described as a $(2,1)$-functor $F_\mathcal{M}\colon\mathbf{Sch}^\mathrm{op}\to\mathbf{Grpd}, X\mapsto \pi^{-1}(X)$, where $\mathbf{Grpd}$ is the $(2,1)$-category of groupoids. This is the Grothendieck construction, or straightenening-unstraightening if you're a fan of higher categories: there is an equivalence of $(2,1)$-categories between the $(2,1)$-category of categories $\mathcal{M}\to\mathbf{Sch}$ fibered in groupoids and the $(2,1)$-category of functors $\mathbf{Sch}^\mathrm{op}\to\mathbf{Grpd}$. See for instance Proposition 3.3 here: https://ncatlab.org/nlab/show/Grothendieck+construction#statement_of_the_equivalence .
Therefore, a morphism $S\to\mathcal{M}$ of categories fibered over groupoids is the same data as a natural transformation $yS\to F_\mathcal{M}$ of functors $\mathbf{Sch}^\mathrm{op}\to\mathbf{Grpd}$, where $yS$ denotes the image of $S\in\mathbf{Sch}$ under the Yoneda embedding, followed by the inclusion $\mathbf{Set}\hookrightarrow\mathbf{Grpd}$ (this is also how the $(2,1)$-categorical Yoneda embedding acts on $S$). Now we invoke the $(2,1)$-categorical Yoneda lemma, which states that there is now an equivalence of groupoids between such natural transformations $yS\to F_\mathcal{M}$ and $F_\mathcal{M}(S)\simeq \pi^{-1}(S)$.