Discreteness of Preimages of points, map between compact riemann surfaces

Let $f:X\rightarrow Y$ be a non-constant holomorphic map between compcat riemann surfaces, we need to show $f^{-1}(y),\forall y\in Y$ is finite and discrete subset of $X$.

What if $X$ and $Y$ are non compact?

well, $f$ is onto clearly, and I understand some how I need to use the fat that $Zeros$ of $f$ is a discrete set, but I am not able to write rigoriously the answer.

• Your description of $S$ doesn't make sense (or describes the empty set in a benevolent interpretation). – Georges Elencwajg Jul 24 '12 at 21:22
• @Patience In a compact space any infinite set has an accumulation point. So any closed and discrete set is finite. – azarel Jul 24 '12 at 21:44
• @GeorgesElencwajg I am sorry!! I will do that from next time, If $X$ and $Y$ are non compact, how will I conclude? – Marso Jul 24 '12 at 21:50

a) If $X$ and $Y$ are non compact it certainly is not clear that $f$ is onto since it is false: think of the inclusion of a disk into $\mathbb C$.
b) It is not true either that the fibers $f^{-1}(y)$ are finite: think of the sinus function $\sin:\mathbb C\to \mathbb C$ with $\sin^{-1}(0)=\pi \mathbb Z$, an infinite set.
c) It is however true that the fibers $f^{-1}(y)\; (y\in Y)$ are discrete closed subsets of $X$: closedness follows from continuity of $f$ and discreteness can be checked locally at points of $x\in X$.
This means that in order to check it you may assume that $X$ and $Y$ are disks containing the origin and that $x=0, f(x)=0$.