Question on Forster's proof of the residue theorem I have some questions about the proof of the residue theorem in Lectures on Riemann Surfaces by Otto Forster.

The Residue Theorem. Suppose $X$ is a compact Riemann surface and $a_1,\cdots,a_n$ are distinct points in $X$. Let $X':= X \setminus \{a_1, \cdots,a_n\}$. Then for every holomorphic 1-form $\omega \in \Omega(X')$, one has 
  $$
\sum_{k=1}^n {\rm Res}_{a_k}(\omega) = 0.
$$

In the proof, $(U_k, z_k)$ are coordinate neighbourhoods of $a_k$. For every $k$, $f_k$ is a function with compact support ${\rm Supp}(f_k) \subset U_k$ such that there exists an open neighbourhood $U'_k \subset U_k$ of $a_k$ with $f_k|U'_k = 1$. Set $g:=1-(f_1+\cdots+f_n)$. Then,
$$
\int\int_X d(g\omega) =0.
$$ 
I have difficulty following the argument from the next sentence.

Now $d(g\omega) = - \sum d(f_k \omega)$ implies
  $$
\sum_{k=1}^n \int\int_X d(f_k \omega) = 0.
$$

Does this mean $d\omega =0$ on $X$? I know $d\omega=0$ on $X'$ since $\omega$ is holomorphic on $X'$. But, $\omega$ is not defined at $a_k$.  
I have one more question probably related to this one.

Using the coordinates $z_k$ we may identify $U_k$ with the unit disk. There exists $0 < \epsilon < R <1$ such that
  $$
{\rm Supp(f_k)} \subset \{ |z_k| < R \} \; \text{and} \; f_k | \{|z_k| \leq \epsilon\}=1.
$$
  But then
  $$
\int\int_X d(f_k\omega)  =
\int\int_{\epsilon \leq |z_k| \leq R} d(f_k\omega) 
   = \int_{|z_k|=R} f_k \omega - \int_{|z_k|=\epsilon} f_k \omega
$$

Does the first equality mean that $d\omega=0$ in $\{|z_k| < \epsilon\}$ ? I cannot understand this by the same reason as my first answer.

I would be really grateful, if someone could help me understand this proof.
 A: Since $\omega$ is a meromorphic form on $X$, on each $(U_k,z_k)$ it has an expression of the form
$$
\omega = f(z)dz
$$
for $f$ a meromorphic function having possibly a pole at $0$. This means that on $U_k\backslash \{a_k\}$, $d\omega = \frac{\partial f}{\partial \overline{z}}(z)d\overline{z}\wedge dz$. Since $\omega$ is holomorphic on $X'$, we see from this expression that $d\omega = 0$ on $X'$.
Now since $\omega$ is not defined at the $a_k$'s, he introduces a function $g$ which is identically $0$ in a neighborhood of the $a_k$'s so that $g\omega$ can be extended by $0$ on the $a_k$'s to a smooth 1-form $\eta$ over all of $X$ (note that it is not necessarily holomorphic anymore). When he writes $\int_X d(g\omega) = 0$, he really means $\int_X d\eta = 0$.
Since $d\omega = 0$ on $X'$, we indeed get $d(g\omega) = -\sum d(f_k\omega)$ on $X'$ and then once again we can extend the RHS (by $0$ on the $a_k$'s) to a smooth 1-form $\xi$ on all of $X$. The reason we can do this is that $d(f_k\omega) = df_k \wedge \omega + f_k d\omega = df_k \wedge \omega$ on $X'$ but $df_k$ is identically $0$ in a neighborhood of the $a_k$'s since $f$ is constant there.
So what we get is two 1-forms $\eta$ and $\xi$ defined on all of $X$ which we know agree on $X'$ and are both $0$ on the $a_k$'s so they agree on all of $X$. So when he writes 
$$
\sum_{k=1}^n \int_X d(f_k\omega) = 0,
$$
it is understood that he means $\int_X \xi = \int_X d\eta = 0$, which is the same thing.
The reason it is the same thing is exactly because of what you wrote in your second question. Since $\xi$ and $d(f_k\omega) = df_k \wedge \omega$ are identically zero in a neighborhood of the $a_k$'s, we can write (using your notations)
$$
\int_X \xi = \sum_{k=1}^n\int_{X'}d(f_k\omega) = \int_{\epsilon \leq |z_k| \leq R} d(f_k\omega).
$$
To get the statement for the residues, we take $\epsilon$ small enough and $R$ big enough so that
$$
0 = \sum_{k=1}^n\int_{X'}d(f_k \omega) = \sum_{k=1}^n\left(\int_{|z_k| = R}f_k \omega - \int_{|z_k| = \epsilon}f_k \omega \right) = -\sum_{k=1}^n \int_{|z_k|=\epsilon}\omega,
$$
and we let $\epsilon \to 0$, which gives
$$
0 = 2\pi i \sum_{k=1}^n\text{Res}_{a_k}\omega.
$$
