I am trying to prove this theorem, Let $X=\prod_{i=1}^n X_i $.
Theorem: Let $f: X \rightarrow X_i$ is a projection map (i.e., surjective with connected fibers) and $ g: X\rightarrow Z$ is a proper morphism that is constant on the fibers of $f$, then there exist a unique morphism $h: X_i \rightarrow Z$ such that $g=h \cdot f$.
I am stuck proving this. Is it a standard theorem, that I can locate in Hartshorne exercise? Or is it wrong?
I know there is something called $Stein$ $factorisation$,(https://en.wikipedia.org/wiki/Stein_factorization#CITEREFEGA) that says,
For a proper morphism $F: X \rightarrow Y$, one can write $F=G\cdot F'$, where $G: Y' \rightarrow Y$ a finite morphism and $F': X \rightarrow Y'$ a proper morphism with direct image of structure sheaf is a structure sheaf.
Now, I am stuck on how to apply and prove our case, if possible.
Any help regarding this would be immensely helpful. Thank you.