Let $X,Y$ be two complex Riemann surface and $f:X\rightarrow Y$ be a nonconstant holomorphic map.
I was told that for any $y\in Y$, $f^{-1}(y)$ is discrete in $X$ because $f$ is nonconstant and $X$ is closed.
I wonder why this statement is true? Particularly, I wonder what "$X$ is closed" contributes here?