# 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?

-

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.)
so $g(X)=0$ on an sequence with limit point $x^*$ in $X$ (for $X$ is closed), then $g(X)$ must be constant, (I remember there is such a theorem, but forget the precise statement, can you tell me?), contradiction..Thank you! –  hxhxhx88 Jan 9 '13 at 2:53