I map a locally closed set $X$ on an open set $Y$ by a polynomial map $f$. I know that for $y\in Y$, $\dim f^{-1}(y)=0$ (finite number of points).
Is it true that $\dim X = \dim Y$?
I found the Theorem on the Dimension of Fibers in Shafarevich's book Basic Algebraic Geometry (Theorem 7 on p. 76) but it works under assumptions that both $X$ and $Y$ are irreducible varieties and in my case $X$ is just a locally closed set, and $Y$ is a nonempty open (and hence irreducible).