When it says that "this shows we can define a function...". Why is this? Why do we get this from greens theorem?.
We have a previous theorem that says
If $f:Ω→C$ is a continuous function in a convex open set $Ω⊂C$ and there exists $p∈Ω$ such that $f$ is analytical in $Ω/{p}$, then $f$ has a primitive(antiderivative) in Ω.
Assuming that $v$ is a primitive, Is this related to it? But the previous theorem only works for convex set.

In the first lines above, the author uses Green's theorem to prove that the line integral around a closed loop $\alpha$ $$ \int_\alpha \left[ - \frac{\partial u}{\partial y} dx + \frac{\partial u}{\partial x} dy \right] = 0. $$ This follows from Green's theorem and the fact that $u$ is a harmonic function ($\Delta u = 0$.)
Because the line integral around any closed loop is zero, it follows that the line integral along an open path $\gamma$ from $p$ to any point $(x,y)$ is independent of the path taken between those points. Thus, the functions $v$ is a function of $x$ and $y$ only, and does not depend on the curve $\gamma$ used to connect them.
Proof of statement about path-independence: If there were two paths $\gamma_1$ and $\gamma_2$ between $p$ and $(x,y)$ for which the integrals were different, we could construct a closed loop starting & ending at $p$ consisting of $\gamma_1$ and then $\gamma_2$ in reverse. By assumption, the contributions from $\gamma_1$ and $\gamma_2$ would not cancel, so the total integral around this loop would be non-zero. But this contradicts the statement that the integral around any closed loop must be zero.