Consider the following exercise:
(1.1) If $f,g: \mathbb{R}^n\to\mathbb{R}$ are functions such that their partial derivatives exist (but are not necessarily differentiable) and $\nabla f(x)=\nabla g(x)$ for all $x\in\mathbb{R}^n$, then $f$ and $g$ differ by a constant
(1.2) Show that the same conclusion holds if $f,g$ don't have $\mathbb{R}^n$ as their domain, but instead, their domain is a pathwise-connected open set.
I have proved (1.1) (using the fact that if $\nabla f(x)=(0,...,0)$ on all its domain, then $f$ is constant on its domain) but I don't see a way to prove (1.2) , more specifically; I don't see a way to use the hypothesis given in the last part of the exercise