Proof (converse of fundamental theorem of calculus)

$\int_γ f = 0$ for all closed curves $γ$

Fix some point $a_0\in U$. For each $w\in U$, choose, by path-connectedness of $U$, a path $γ_w$ in $U$ from $a_0$ to $w$, and define $$ \begin{align*} F(w) := \int_{γ_w} f. \end{align*} $$

To check $F' = f$, for each $w\in U$, pick some $r>0$ such that $B(w,r)\subseteq U$. Let $w+h \in B(w,r)$ and $δ_h$ be the straight line path from $w$ to $w+h$.

Note that $γ_w + δ_h - γ_{w+h}$ is a closed path. Therefore by hypothesis, $$ \begin{align*} F(w+h) = \int_{γ_{w+h}} f = \int_{γ_w} f + \int_{δ_h} f = F(w) + hf(w) + \int_{δ_h} f(z) - f(w) \d z. \end{align*} $$ Thus $$ \begin{align*} \left|\frac{F(w+h) - F(w)}{h} - f(w)\right| ={}& \left|\frac{1}{h}\int_{δ_h} f(z) - f(w) \d z\right| \\ \leq{} & \frac{1}{|h|} \cdot \mathrm{length}(δ_h) \cdot \sup_{z\in δ_h} |f(z) - f(w)| \to 0 \end{align*} $$ as $h\to 0$ by continuity of $f$.

$U$ starlike and $\int_γ f = 0$ for all closed triangles $γ$

Take $a_0\in U$ be the point where the line segment between $a_0$ and any $w\in U$ lies inside $U$, and pick $γ_w$ be such line segment. The above argument follows by noticing $γ_w + δ_h - γ_{w+h}$ is the boundary of a triangle.