This is the exercise:
Denote by $\Omega$ the square $\lbrace (x_1,x_2) \in \mathbb{R}^2 \vert \, \vert x_1 \vert < 1, \vert x_2 \vert<1 \rbrace$. Define $u(x)$ in this way:
$1-x_1$ if $\vert x_2 \vert < x_1$
$1+x_1$ if $\vert x_2 \vert < -x_1$
$1-x_2$ if $\vert x_1 \vert < x_2$
$1+x_2$ if $\vert x_1 \vert < -x_2$.
For which $p \in [1,\infty]$ does $u$ belong to $W^{1,p}(\Omega)$?
I tried calculating the $\| \cdot \|_{W^{1,p}}$, but it is finite for all $p$. Is it correct or I made any mistake?
Yes, it is correct. You can easily see that $u \in W^{1,\infty}(\Omega)$ and since $\Omega$ is bounded, it follows that $u \in W^{1,p}(\Omega)$ for all $p \geq 1$.