Let $U\subset \mathbb{R}^{n}$ be an open set and $f:U \to \mathbb{R}$ a continuous function which is piecewise $C^{1}$. This is: there is a partition of $U$ by (say, a finite number of) open sets $U_{\alpha}$, each with piecewise $C^{1}$ boundary, such that $f$ restricted to each of these is $C^{1}$.
My question is the following: (when) are the weak derivatives of $f$, $D_{i} f$, given by the piecewise defined functions $g_{i}|_{U_{\alpha}}=D_{x_{i}}(f|_{U_{\alpha}})$? Where can I find a proof if the case?
With the exception of some pathological cases, this will usually be true. Just verify the definition of weak derivative:
$$ \int_U f D_i \varphi dx = \sum_{\alpha} \left( \int_{\partial U_\alpha} f \varphi \nu_i dS - \int_{U_\alpha} \varphi D_i f dx\right)$$
where $\nu_i$ is the $i^{th}$ component of the normal vector to $\partial U_\alpha$. Then we have
$$ \int_U f D_i \varphi dx = -\int_{U} \varphi D_i f dx + \sum_{\alpha} \int_{\partial U_\alpha} f \varphi \nu_i dS.$$
I would expect the term on the right side to be zero, besides maybe in pathological cases, since each boundary should be shared by two regions and the normal vector $\nu_i$ will be of opposite sign in each region.