How singular can the Stein factorization of a proper map between smooth varieties be? A little bit of motivation (the question starts below the line): I am studying a proper, generically finite map of varieties $X \to Y$, with $X$ and $Y$ smooth. Since the map is proper, we can use the Stein factorization $X \to \hat{X} \to Y$. Since the composition is generically finite, $X \to \hat{X}$ is birational, and therefore a sequence of blowups. I am currently interested in the other map: $\hat{X} \to Y$. I would like to apply Casnati–Ekedahl's techniques from “Covers of algebraic varieties I” (Journal of alg. geom., 1996). For this, I need $\hat{X} \to Y$ to be Gorenstein. (Since $Y$ is Gorenstein (since it is smooth), this is equivalent with $\hat{X}$ being Gorenstein.) When is this true?
Specifically, in my case $X \to Y$ is the albanese morphism of a smooth projective surface: so $Y$ is an abelian surface, and I am in the situation that the albanese morphism is surjective.

Let $f \colon X \to Y$ be a proper map between two varieties $X$ and $Y$ over a field $k$. Assume $X$ and $Y$ are smooth (and proper, if you want).
Let $\pi \colon X \to \hat{X}$ and $\hat{f} \colon \hat{X} \to Y$ be the Stein factorization ($f = \hat{f} \circ \pi$). Of course, in general $\hat{X}$ is not smooth. However:

Q1: Does $\hat{X}$ have some other nice properties?

I am thinking in the direction of, e.g., Gorenstein or Cohen–Macaulay. If not, does it help if we assume a bit more on $f$? Or, alternatively:

Q2: Under what conditions is $\hat{X}$ Gorenstein?

 A: The only restriction I see is that $\hat{X}$ must be normal (because $X$ is): if $\phi$ is a rational function on (some affine open subscheme of) $\hat{X}$ which is integral over $\mathscr{O}_\hat{X}$, then $\phi\circ\pi$ is integral over $\mathscr{O}_{X}$, hence in $\mathscr{O}_{X}$. In other words, $\phi$ lies in $\pi_*\mathscr{O}_{X}=\mathscr{O}_\hat{X}$.
A: $\hat{X}$ can be as bad as you want. For example, take your favorite non-Gorenstein variety $\hat{X}$ in $\mathbb{A}^N$. By Noether Lemma there is a finite morphism $\hat{X} \to \mathbb{A}^n =: Y$. Take $X$ to be a resolution of singularities of $\hat{X}$. Then $X \to Y$ is a quasifinite morphism between smooth varieties.
A: For what it's worth, one can say the following sort of thing.
Since $Y$ is log terminal so is $(\hat{X}, -\mathrm{Ram})$.  This doesn't mean much since in the pair, the boundary has a negative coefficients (ie, the singularities of $\hat{X}$ can be arbitrarily bad).  But it does say things like:
if $\hat{X}$ has really bad singularities at some points, then $\mathrm{Ram}$ also has really bad singularities at those points too.  Another way to say this is if the ramification divisor has mild singularities, then $\hat{X}$ does too.  
Note that of course, $K_{\hat{X}} + (-\mathrm{Ram}) \sim f^*(K_Y)$.  The right side is Cartier, and thus so is the left.  So the pair $(\hat{X}, -\mathrm{Ram})$ is log-Gorenstein (again, this doesn't mean much unless you control the ramification divisor in some sense).  
A: There are three good answers to this question, and together they have more or less answered what I wanted to know. I find it hard to choose one of them as best, but nevertheless I think this question should have an accepted answer to move it from the unanswered list. Hence a CW-answer summarizing the (in my eyes) most important points made.



*

*Laurent Moret-Bailly points out that $\hat{X}$ must be normal.

*Sasha then says that besides that, it can get as bad as you want. Take a normal subvariety $\hat{X} \subset \mathbb{A}^{N}$. By Noether's lemma we get a finite map $\hat{X} \to \mathbb{A}^{n} = Y$. A resolution of singularities $X \to \hat{X}$ has connected fibres. The composition $X \to Y$ is generically finite.

*Karl Schwede remarks that the pair $(\hat{X}, -\mathrm{Ram})$ is log-Gorenstein (where $\mathrm{Ram}$ is the ramification divisor). He also states the slogan “if $\hat{X}$ has really bad singularities at some points, then $\mathrm{Ram}$ also has really bad singularities at those points too. Another way to say this is if the ramification divisor has mild singularities, then $\hat{X}$ does too.”
