TITLE: Fibrations of projective varieties
QUESTION [5 upvotes]: Let $f:X\rightarrow Y$ be a flat morphism of normal projective varieties with fibers of positive dimension (in particular all the fibers are connected and of the same dimension).
Let $g:X\rightarrow Z$ be another morphism with connected fibers of positive dimension. Assume that $g$ contracts the general fiber of $f$ to a point of $Z$. Is it true that then $g$ must contract any fiber of $f$ to a point of $Z$? 
In other words, is the map
$$Y\rightarrow \mathbb{Z},\: y\mapsto dim(g(f^{-1}(y)))$$
continuous?

REPLY [6 votes]: Another proof: The assumptions imply that $X\times_YX$ is irreducible and that the two composite maps $X\times_YX\rightrightarrows X\xrightarrow{g}Z$ coincide over the generic point of $Y$. By density they must be equal (I have to assume $Z$ separated here), so $g$ is constant along the fibers of $f$ (and, by descent, $g$ factors through $Y$).