TITLE: How singular can the Stein factorization of a proper map between smooth varieties be?
QUESTION [7 upvotes]: 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?

REPLY [2 votes]: 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.”