Consider the factorization $$ \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X} \to \mathcal{X} \times_\mathcal{Z} \mathcal{X} $$ of the diagonal morphism of $g \circ f$. Both morphisms are representable by algebraic spaces, see Lemmas \ref{lemma-properties-diagonal} and \ref{lemma-fibre-product-after-map}. Hence for any scheme $T$ and morphism $T \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$ we get morphisms of algebraic spaces $$ A = \mathcal{X} \times_{(\mathcal{X} \times_\mathcal{Z} \mathcal{X})} T \longrightarrow B = (\mathcal{X} \times_\mathcal{Y} \mathcal{X}) \times_{(\mathcal{X} \times_\mathcal{Z} \mathcal{X})} T \longrightarrow T. $$ If $g \circ f$ is DM (resp.\ quasi-DM), then the composition $A \to T$ is unramified (resp.\ locally quasi-finite). Hence (1) (resp.\ (2)) follows on applying Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-permanence-unramified} (resp. Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-permanence-quasi-finite}). This proves (1) and (2). \medskip\noindent Proof of (4). Assume $g \circ f$ is quasi-separated and $\Delta_g$ is quasi-separated. Consider the factorization $$ \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X} \to \mathcal{X} \times_\mathcal{Z} \mathcal{X} $$ of the diagonal morphism of $g \circ f$. Both morphisms are representable by algebraic spaces and the second one is quasi-separated, see Lemmas \ref{lemma-properties-diagonal} and \ref{lemma-fibre-product-after-map}. Hence for any scheme $T$ and morphism $T \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$ we get morphisms of algebraic spaces $$ A = \mathcal{X} \times_{(\mathcal{X} \times_\mathcal{Z} \mathcal{X})} T \longrightarrow B = (\mathcal{X} \times_\mathcal{Y} \mathcal{X}) \times_{(\mathcal{X} \times_\mathcal{Z} \mathcal{X})} T \longrightarrow T $$ such that $B \to T$ is quasi-separated. The composition $A \to T$ is quasi-compact and quasi-separated as we have assumed that $g \circ f$ is quasi-separated. Hence $A \to B$ is quasi-separated by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-compose-after-separated}. And $A \to B$ is quasi-compact by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-quasi-compact-permanence}. Thus $f$ is quasi-separated. \medskip\noindent Proof of (3). Assume $g \circ f$ is separated and $\Delta_g$ is separated. Consider the factorization $$ \mathcal{X} \to \mathcal{X} \times_\mathcal{Y} \mathcal{X} \to \mathcal{X} \times_\mathcal{Z} \mathcal{X} $$ of the diagonal morphism of $g \circ f$. Both morphisms are representable by algebraic spaces and the second one is separated, see Lemmas \ref{lemma-properties-diagonal} and \ref{lemma-fibre-product-after-map}. Hence for any scheme $T$ and morphism $T \to \mathcal{X} \times_\mathcal{Y} \mathcal{X}$ we get morphisms of algebraic spaces $$ A = \mathcal{X} \times_{(\mathcal{X} \times_\mathcal{Z} \mathcal{X})} T \longrightarrow B = (\mathcal{X} \times_\mathcal{Y} \mathcal{X}) \times_{(\mathcal{X} \times_\mathcal{Z} \mathcal{X})} T \longrightarrow T $$ such that $B \to T$ is separated. The composition $A \to T$ is proper as we have assumed that $g \circ f$ is quasi-separated. Hence $A \to B$ is proper by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-universally-closed-permanence} which means that $f$ is separated.