TITLE: Image of point of codimension one has codimension one?
QUESTION [5 upvotes]: I'm working on the following exercise (7.2.3) from Liu's Algebraic Geometry and Arithmetic Curves:

Let $f: X \rightarrow Y$ be a morphism of Noetherian schemes. We suppose that either $f$ is flat or $X,Y$ are integral and $f$ is finite surjective.
  Let $x \in X$ be a point of codimension $1$, and $y = f(x)$. Show that $\dim \mathcal{O}_{Y,y} = 1$ if $f$ is finite surjective...

Is this statement true? The going-up theorem only shows that $\dim V(y) = \dim V(x)$, which is not the same thing, since it is not always true that $\dim V(y) + \dim \mathcal{O_{Y,y}} = \dim Y$. It seems to me like we need the going-down theorem, which requires an additional normality hypothesis on $Y$. I think the problem is that $\mathcal{O}_{Y,y} \rightarrow \mathcal{O}_{X,x}$ is not necessarily finite.

REPLY [2 votes]: No, this is not true. There is a famous example of Nagata of a Noetherian local domain $A$ of dimension $2$ which has a finite overring $A \subset B$ with two maximal ideals $\mathfrak m, \mathfrak n \subset B$ with $\dim(B_{\mathfrak m}) = 2$ and $\dim(B_{\mathfrak n}) = 1$. Let $X$ be the spectrum of $B$ and $Y$ be the spectrum of $A$ and let $x$ be the point corresponding to the prime ideal $\mathfrak n$.
The example can be found in Appendix, Example 2 of Nagata's book ``Local rings'' published in 1962. See also Tag 02JE.