Let $f: X\to Y$ be a finite (surjective) morphism between two algebraic varieties. I know when $X$ and $Y$ are nonsingular and $\dim Y =1$, $f$ is flat. But in general, is it true that $f$ is a flat morphism?

If X and Y are both regular, then this is true. In fact, it's true more generally if Y is regular and X is CohenMacaulay (Eisenbud, Commutative Algebra, Corollary 18.17). In general it's certainly false. 

