I want to prove that if $f: X\rightarrow Y$ is a closed immersion, $Y$ is integral and $\dim X=\dim Y$, then $f$ is an isomorphism.
My idea: $Y$ is integral means $Y$ is irreducible, since $f(X)$ is closed in $Y$ and $\dim X=\dim Y$, then $f$ is surjective. But a surjective closed immersion is not necessary an isomorphism.
How to continue to show $f$ is an isomorphism?
Thanks!
The only surjective closed immersion in to a reduced scheme is an isomorphism. It suffices to verify this affine-locally, where every closed immersion is isomorphic to a closed immersion of the form $\operatorname{Spec} A/I \to \operatorname{Spec} A$.
So let $A$ be a ring, $I\subset A$ an ideal, and suppose that $\operatorname{Spec} A/I \to \operatorname{Spec} A$ is a surjective closed immersion. This means that there is a bijection between prime ideals of $A$ and prime ideals of $A/I$. But the prime ideals of $A/I$ are exactly the prime ideals of $A$ containing $I$, so this means that $I$ must be contained in the intersection of all prime ideals. This is exactly the nilradical of $A$, which is zero iff $R$ is reduced. Thus every surjective closed immersion in to a reduced scheme is an isomorphism.