Q:

Why the preimage of a function between two complex Riemann surface is discrete?

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?

A:

If $f^{-1}(y)$ was not discrete, what could you say about the holomorphic function $g(x) = f(x)-y$?  (I'm assuming $X$ is connected.)

