I'm learning about de Jong's theory of resolution of singularities and the following fact is used numerous times: an alteration of varieties $h: X \rightarrow Y$ factors as $X \xrightarrow{\pi} Z \xrightarrow{f} Y$, where $\pi$ is a modification and $f$ is a finite morphism. From an exercise in Hartshorne I know I can find a dense open subset in $U \subset Y$ such that the induced morphism $h^{1}(U) \rightarrow U$ is finite, but I don't know where to go from there. I thought to blowup the respective closed sets away from these open subsets, but then I'd be moving away from my original varieties. I get the sense this is a known fact. Anyone know a simple proof?
As Sandor points out, this is Stein factorization. Let $X$, $Y$ be varieties over a field $K$. Let $h: X\to Y$ be a proper morphism. Then $h_*(O_X)$ is coherent and $Y':=Spec(h_*(O_X))$ (cf. EGA II.1.3 for the definition of $Spec$ of a sheaf of quasicoherent algebras) is finite over $Y$. Consider the Stein factorization $$h:X\buildrel h' \over\longrightarrow Y'\buildrel g\over \longrightarrow Y$$ of $h$. (It is true by Zariski's connectedness theorem (cf. EGA III.4.3.1  III.4.3.4) that $h'$ has nonempty geometrically connected fibres and $g$ is finite, but this will not be needed here). Now assume that $h$ is an alteration, i.e. that $h$ is surjective and that there exists a nonempty open subscheme $U\subset Y$ such that $h^{1}(U)\to U$ is finite. Replacing $U$ by a smaller set we may assume that $U=Spec(A)$ is affine. Define $U'=g^{1}(U)$ and $V=h^{1}(U)$. Then $V=Spec(B)$ for some $A$algebra $B$, because $h$ is affine as a finite morphism. We thus have $h_*(O_X)(U)=B$. Hence it follows from the definition of the sheaf Spec that $U'=Spec(B)$ and the restriction $h': V\to U'$ is an isomorphism. Hence $h': X\to Y$ is a modification. Note that this argumentation does not use the full strength of Zariski's connectedness theorem in an essential way here. Most of the things are in a sense "a tautology". The only somewhat deeper fact entering is the fact that $h_*(O_X)$ is coherent, because of the properness assumption. Concerning your comment, the following is clearly true: If $f: X\to Y$ is a finite morphism and $f_*(O_X)=O_Y$, then $f$ is an isomorphism. 


This is Stein factorization Hartshorne, III.11.5. 


Thanks to Sándor for the idea of Stein factorization. By Stein factorization as proven in EGA III, 4.3.3 for proper morphisms we have that $\phi$ (I've switched the direction of the morphism) factors as $Y \xrightarrow{\pi} Z \xrightarrow{f} X$ with $\pi$ a morphism with connected fibres and $f$ a finite morphism. By [Hart] II.4.8(e) $\pi$ must be proper. First we note that it's enough to assume that $\pi$ is surjective since it's proper and thus has closed image. Moreover since closed immersions are proper then $\pi$ would remain proper. Also the image of an irreducible scheme is irreducible, so we may assume $Z$ is irreducible, and in fact integral. Now consider the generic fiber of $f$, i.e. $f^{1}(\eta)$, where $\eta$ is the generic point of $X$. On the one hand we have $\phi^{1}(\eta)$ and $f^{1}(\eta)$ are finite sets since they are generically finite and finite, respectively. On the other hand, the fiber of $\pi$ over each one of the finite points in $f^{1}(\eta)$ must be connected and also finite. Thus the fiber over each one of these points is at most a point. Since now $\pi$ is a surjective morphism between integral schemes we get that $\pi(\zeta)=\nu$, where $\zeta,\nu$ are the generic points of $Y,Z$ respectively, and moreover $\pi^{1}(\nu)=\zeta$. From the proof of [Hart] Exercise II.3.7, we get that the function fields of $Y$ and $Z$ are equal, and thus indeed $\pi$ is birational. Sound good (albeit wordy)? 

