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?