Fibrations of projective varieties 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?
 A: 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$).
A: For each point in $Y$, take a curve  $C \subseteq Y$ that passes through that point and the generic point. Let $X'= X \times_{Y} C$. Then the generic fiber of $f': X' \to C$ is still irreducible, and because $f$ is flat no irreducible component is contained in a special fiber, so $X'$ is irreducible.
Consider the image of $X'$ in $C \times Z$. It is closed and irreducible, and is zero-dimensional over the generic point of $C$. Hence it is an irreducible curve with a nonconstant map to $C$. Thus every fiber of the map to $C$ is zero-dimensional.
Hence every fiber of the map from the image of $X$ in $Y \times Z$ to $Y$ is zero-dimensional, as desired.
