Proving the existence of a branch point in a complex plane. (Complex Analysis)

Prove the following proposition

If there exists a branch $F(z)$ of log$z$ in the domain $D$, then any other

branch is of the form $F(z) + 2k$$\pi i, for some k \in \mathbf Z Conversely F(z) + 2k$$\pi i$ is a branch of log$z$ for any $k \in$ $\mathbf Z$

Proof

Suppose that $F(z)$ and $G(z)$ are two branch of log$z$, then the difference

$$H(z)=\frac{F(z)-G(z)}{2\pi i}$$

is a continuous function in $D$ which takes only integer values.

Since $D$ is a domain, in particular it is connected, such a function is necessarily constant and we will prove this fact.

The set of points $z\in D$ such that $H(z)$ is equal to a given integer $n$ is both open and closed, and so the set is either empty or equal $D$.

the constant must therefore be an integer.

Thus $F(z) + 2k$$\pi i is a branch of logz for any integer k is obvious. Intuitively i understood what the theorem meant because the branch H(z) have to go in cycles of 2$$\pi$ and thus there will be a repetition in each cycle but

I dont quite understand the prove above especially from the part onwards

'The set of points $z\in D$ such that $H(z)$ is equal to a given integer...'

Could someone explain this proof to me. Thanks

Since both $F$ and $G$ are representants of $\log z$ it follows that $$F'(z)=G'(z)={1\over z}\qquad(z\in D)\ .$$ So $H'(z)\equiv0$ in $D$, and as $D$ is connected $H$ has to be constant in $D$.
That this constant has to be of the form $2k\pi i$ with $k\in{\mathbb Z}$ does not follow from your argument. It follows from $e^{F(z)}=e^{G(z)}\equiv z$, or $e^{F(z)-G(z)}\equiv1$.