Injective map between sheaf cohomologies I am currently working through Forster's Lectures on Riemann Surfaces and I may be on the right track on this exercise, but I'd like to make sure. The exercise in question is 12.3:

Let $X$ be a compact Riemann surface. Prove that the map $$h: H^1(X, \mathbb{Z}) \to H^1(X, \mathbb{C}),$$ induced by the inclusion $\mathbb{Z} \subset \mathbb{C}$, is injective.

I am assuming that the map is quite literally sending the cocycles $(a_{ij})$ of locally constant functions with values in $\mathbb{Z}$ to themselves in $H^1(X, \mathbb{C})$. So my approach was to show that any cocycle $(a_{ij})$ in $H^1(X, \mathbb{Z})$ that splits in $H^1(X, \mathbb{C})$ must also split in $H^1(X, \mathbb{Z})$. In other words, I have that $a_{ij} = f_j - f_i$ for some locally constant functions in $\mathbb{C}$ on the appropriate intersection of open sets in a finite cover of $X$. But I'm not quite sure how to conclude that $f_i, f_j$ must also be integer-valued locally constant functions unless I am missing something incredibly obvious.
The second part of the exercise asks to show that $H^1(X, \mathbb{Z})$ is a finitely generated free $\mathbb{Z}$-module, but I think I've got this covered: since $H^1(X, \mathbb{C})$ is a finite dimensional vector space, then $H^1(X, \mathbb{Z})$ is also a finite dimensional $\mathbb{Z}$-module. As $X$ is compact, then we can obtain a finite open cover that generates $H^1(X, \mathbb{Z})$. Assuming the previous part, $H^1(X, \mathbb{Z})$ is free because otherwise there would be a non-trivial cocycle (some non-zero locally constant integer-valued function) with finite order (in the group sense). But this cannot occur, since $\mathbb{Z}$ is free.
Please correct me where I'm wrong, and any helpful hints are always welcome!
 A: You have a cover $\{U_i\}$, which you may assume is finite, and by refining it you may assume $U_i \cap U_j$ is connected or empty. You also have a bunch of integers $a_{ij}$, and a bunch of complex numbers $z_i$ such that for any $i, j$, either $U_i \cap U_j$ is empty or $z_i - z_j = a_{ij}$.
You want to prove that there are a bunch of integers $n_i$ with the same property as the complex numbers $z_i$. Fix one open set $U_0$ in your cover, then for each $i$ set $n_i = z_i - z_0$. Clearly the $n_i$ satisfy $n_i - n_j = a_{ij}$, but we still need to check that they are integers.
If $U_i$ meets $U_0$, this is clear, since $n_i = a_{i0}$. If not, using connectedness, you can find a sequence of opens $V_0, V_1, \ldots, V_m$ such that $V_0 = U_0$, $V_m = U_i$, and $V_j \cap V_{j+1} \neq \emptyset$. Then inductively on $m$ you can prove that $n_m$ is an integer.
This proof uses compactness because it uses the finiteness of the cover at the last step, which shouldn't be necessary -- using the long exact sequence in cohomology attached to the short exact sequence $0 \to \mathbb{Z} \to \mathbb{C} \to \mathbb{C}^{\times} \to 1$ should give this result in full generality.
