$W^{1,p}_{per}(Y)$ is the closure of $C^\infty_{per}(Y)$ (functions $C^\infty$ Y-periodicm where Y is a rectangular block) in the $W^{1,p}$ norm. Of course, the trace of of a function in this space in opposite sides of the rectangular block Y are the same.
Lemma: Let $g\in L^p(Y,\mathbb{R}^n)$ such that $\displaystyle\int_Y g\nabla\varphi=0, \forall\varphi\in W^{1,p}_{per}(Y)$. Then $g$ can be extended by periodicity to an element of $L^P_{loc}(\mathbb{R}^n,\mathbb{R}^n)$, still denoted by $g$, such that -div $g=0$ in $\mathcal{D}'(\mathbb{R}^n)$.
How to prove this lemma? I have no idea. Can anybody help me?