My problem is the following: I want to find a bounded domain $\Omega\subset\mathbb{R}^N$ such that if $u\in W_0^{1,p}(\Omega)$, $p\in (1,\infty$), then the extension by zero of $u$ to $\mathbb{R}^N$ is not in $W_0^{1,p}(\mathbb{R}^N)$.
If such $u$ do exist, then the problem must be a problem of "differentiability" in $\partial\Omega$, but I could not figure out how to construct such $u$.
I would like to note that if $\Omega\in C^{0,1}(\Omega)$, then such $u$ does not exist because we have a extension operator between $W^{1,p}(\Omega)$ and $W^{1,p}(\mathbb{R}^N)$.
Thank you
There is no such domain. By definition of $W^{1,p}_0(\Omega)$, $u$ is a $W^{1,p}$ limit of smooth compactly supported functions $u_n$. Extend each $u_n$ by zero; you now have a sequence of smooth compactly supported functions which converges in $W^{1,p}(\mathbb R^N)$. Its limit is an element of $W^{1,p}_0(\mathbb R^N)$, which is nothing else but the zero extension of $u$.
The problem of smoothness of $\partial \Omega$ comes up when you interpret the vanishing of $u$ on the boundary differently, i.e., in the sense of traces. Then the question becomes: does having zero trace imply $u\in W^{1,p}_0(\Omega)$? If $\partial \Omega$ is Lipschitz, this is true (e.g., Theorem 15.29 in A first course in Sobolev spaces by Leoni). (I see that you know the last part, but it was natural to include it for completeness).