The exercise is the following:
Let $\Omega$ be open bounded with smooth border, $u \in W^{1,p}(\Omega)$ and $v \in W^{1,p}(\mathbb{R}^d\backslash \bar{\Omega})$. One defines $w$ as $u$ on $\Omega$ and $v$ on $\mathbb{R}\backslash \bar{\Omega}$.
Prove that $w$ is in $W^{1,p}(\mathbb{R}^d)$ if and only if $\operatorname{trace}(u) = \operatorname{trace}(v)$.
I don‘t understand why $w$ shouldn‘t be in $W^{1,p}$ i.e. which part of the definition of $W^{1,p}$ doesn‘t work out.
Can someone help me?