Let $f: (0,1)\times (0,1) \to \mathbb{R}$ be a function such that $$f(x,y) \in W^{1,1}((0,1)\times (0,1))$$ and $$\partial_{x}f(x,y) = 0 \quad \text{ a.e. (weak derivative).}$$
How do I prove that there exists a function $$h(y) \in L^1(0,1)$$ such that $$f(x,y) = h(y)$$ for a.e. $(x,y) \in (0,1)\times(0,1)$?
This should be trivially true if $f$ is regular, but why is that?
Consider the usual approximation $f_\varepsilon \to f$ in $L^1((0,1)^2)$, where $f_\varepsilon$ are smooth functions obtained by convolution: $f_\varepsilon = f * \varphi_\varepsilon$.
The classical derivative $\partial_x f_\varepsilon$ exists and equals $f * \partial_x \varphi_\varepsilon$. By the definition of the weak derivative, this equals $\partial_x f * \varphi_\varepsilon$ (for points $p \in (0,1)^2$ with $\operatorname{dist}(p,\partial (0,1)^2) > \varepsilon$). We know that $\partial_x f \equiv 0$, so also $\partial_x f_\varepsilon \equiv 0$. But $f_\varepsilon$ is smooth, so we infer that $f_\varepsilon$ doesn't depend on the $x$ variable.
Consider the subspace of such functions: $$ V := \{ g \in L^1((0,1)^2) : g(x,y) = h(y) \text{ for some } h \in L^1(0,1) \} $$ It is easily seen that $V$ is complete (as it's isometric with $L^1((0,1))$) and hence a closed subspace of $L^1((0,1)^2)$. Since $f_\varepsilon \in V$ and $f_\varepsilon \to f$ in $L^1((0,1)^2)$, we also have $f \in V$.
The above reasoning has a little flaw: $f * \partial_x \varphi_\varepsilon = \partial_x f * \varphi_\varepsilon$ doesn't work for points close to the boundary. We can bypass it by taking a smaller domain $U_\delta = (-1+\delta,1-\delta)^2$ and considering only $\varepsilon < \delta$. Then we get that $f|_{U_\delta}$ doesn't depend on the $x$ variable. Taking all possible values of $\delta > 0$, we obtain the claim for $(-1,1)^2$.