Let $X,Y$ be Riemann surfaces and $f: X \to Y$ be a nonconstant holomorphic map.
It is well known that if $X$ is compact, or more generally if $f$ is a proper map, then the branch points of $f$ form a discrete subspace of $Y$. In trying to understand why this is true, I came up with a proof that seems to work even more generally when $f$ is just a closed map, but I don't find that result stated anywhere. So probably there might be something wrong with my proposed argument. The main difference between this case and $f$ being proper is that the fibers are guaranteed to be finite, but I don't see considering infinite fibers would break down the following proof.
Could you tell me whether this argument works or if it breaks down somewhere?
Proposed proof: Let $y_0 \in Y$ be a branch point of $f$ and $(V, \psi)$ some chart for $Y$ around $y_0$. For each $x_i \in f^{-1}(y_0)$, we can find a chart $(U_i, \varphi_i)$ for $X$ around $x_i$ such that the local representation of $f$ in these charts is $z \mapsto z^{m_i}$, where $m_i$ is the multiplicity of $f$ at $x_i$. Now, define $$V' := Y \setminus f\left(X \setminus \bigcup U_i\right).$$ The fact that $f$ is closed implies that $V' \subseteq Y$ is open. Since $\bigcup U_i$ contains all preimages of $y_0$, it follows that $y_0 \in V'$. Moreover, for all $x \in X$ we have that $f(x) \in V'$ implies $x \in \bigcup U_i$. Now note that if $x \in \bigcup U_i$ is a ramification point of $f$, it has to be one of the $x_i$, due to the form of the local representations in each $U_i$. It follows that $V'$ does not contain any branch points apart from $y_0$.
Since we can do this for any branch point, we conclude that they form a discrete subspace of $Y$.