It is proven in "General Topology" by Bourbaki (Ch. I.10, Theorem 1; see also references given by M.C. in a comment below the answer) that a continuous map $f:X\to Y$ of two topological spaces is proper if and only if it is closed and all point-preimages (aka fibers) of $f$ are compact. (Note that Bourbaki is using a slightly nonstandard definition of proper maps. However, properness in Bourbaki sense implies usual properness, see Ch. I.10, Proposition 6 in the same book.)
Now, suppose that $f:X\to Y$ is a continuous closed map between locally compact 2nd countable Hausdorff spaces. We are looking for sufficient conditions for $f$ to have compact fibers. I will give two, the second is more general than the first.
- All fibers of $f$ are nowhere dense in $X$. For instance, if $X$ is a connected complex manifold and $Y$ is a complex manifold, then every nonconstant holomorphic map $f: X\to Y$ satisfies this property. If, additionally, $X$ is 1-dimensional, then point-preimages are even discrete.
Lemma 1. If $f:X\to Y$ is a continuous closed map between locally compact metrizable spaces with nowhere dense fibers then $f$ is proper.
Proof. Let $X^+=X\cup \{\infty\}$ denotes the
1-point compactification of $X$. Since $X$ is assumed to be locally compact, 2nd countable, the space $X^+$ is 2nd countable and Hausdorff as well (it is a nice exercise). One says that a sequence $(x_n)$ in $X$ "diverges to infinity" if it converges to $\infty$ in $X^+$
Local compactness of $X$ ensures that $X^+$ is Hausdorff. Maybe this property can be avoided, but I prefer to have uniqueness of limits.
Suppose now that $y\in Y$ is such that $F=f^{-1}(y)$ is noncompact. Then $F$ has nonempty intersection with every neighborhood of $\infty\in X^+$. By the 2nd countability of $X^+$, it follows that there exists a sequence $x_n\in F$ which diverges to $\infty$. Since $F$ is nowhere dense and $X$ is 2nd countable (1st countable suffices), for each $n$ there is a sequence $z_{nk}\in F^c=X\setminus F$ converging to $x_n$. After passing to a suitable diagonal subsequence, we find a sequence $z_n\in F^c$ such that:
(a) $z_n$ diverges to infinity.
(b) $\lim_{n\to\infty} f(z_n)=y$.
Since $z_n\notin F$ for all $n$, we obtain a closed subset $Z=\{z_n: n\in {\mathbb N}\}\subset X$ such that $f(Z)$ is not closed (since $y\notin f(Z)$, but $y$ belongs to the closure of $f(Z)$). A contradiction. qed
Corollary 1. Suppose that $X, Y$ are complex manifolds, $X$ is connected, $f: X\to Y$ is nonconstant, holomorphic and closed. Then $f$ has compact fibers and is proper. In particular, the image under $f$ of any discrete closed subset of $X$ is discrete and closed in $Y$.
Corollary 2. Suppose that $X, Y$ are (connected) Riemann surfaces, $f: X\to Y$ is nonconstant, holomorphic and closed. Then $f$ has finite fibers and the set of critical values of $f$ is discrete.
Remark. Of course, proving it directly is easier than proving the more general results above and below.
Now, back to the general topology:
- For every $y\in Y$, the preimage $F=f^{-1}(y)$ has noncompact boundary whenever $F$ is noncompact. This condition, for instance, rules out constant maps of noncompact spaces $X$ to $Y$.
Lemma 2. Suppose that $f:X\to Y$ is a continuous closed map between locally compact metrizable spaces and for every $y\in Y$, the preimage $f^{-1}(y)$ has noncompact boundary. Then $f$ is proper.
The proof is similar to that of Lemma 1 and I omit it.
Best Answer
Attempt at answering, I'm a novice too: I don't think you need a local inverse nor a system of coordinates.
You know that $f(x)$ should be a point in the preimage of $h(x)$ by $g$. Even when $h(x)$ is a branching value, there's a neighborhood $U$ of $h(x)$ such that $g^{-1}(U)$ is composed of a finite number of disjoint connected components $V_i$, and each of them contains only one preimage of $h(x)$ by $g$. This is because points in the same fiber must be isolated for holomorphic maps.
If $D$ is small enough, then $f(D-\lbrace x\rbrace)$ will be contained in only one of the $V_i$ (because continuous maps preserve connectedness), call it $V$. Then you define $f(x)$ to be the only point $y\in V$ with $g(y) = h(x)$.