A simple case to understand why it is sometimes not possible to define traces is when the space is $L^p$. Then the functions are defined only almost everywhere so the trace has no meaning. On the other hand, a meaning can easily be given when a the space embeds in the space of continuous functions (which is the case of $W^{s,p}(\mathbb R^d)$ when $s > d/p$).
For the case $p=2$, in the book of L. Tartar, An Introduction to Sobolev Spaces and Interpolation Spaces, you will find a chapter about trace for $H^s$ spaces when $s>1/2$. In the case $s=1/2$, there is an interesting special space $H^{1/2}_{0,0}$.
More generally, you can find the result in Triebel's book Theory of Function Spaces II, Section 4.4. If you do not know Besov and Triebel Lizorkin generalizations of Sobolev's spaces, you just have to know that
- Bessel fractional Sobolev spaces are $H^{s,p} = F^{s}_{p,2}$
- Fractional Sobolev-Slobodeckij spaces are $W^{s,p} = F^{s}_{p,p} = B^{s}_{p,p}$.
Then the result is that if $p\in[1,\infty]$ and $s> 1/p$, then the trace is continuous from $F^s_{p,q}$ to $F^{s-1/p}_{p,p}$.
When one speaks of an element of a Sobolev space $u\in W^{k,p}(\Omega)$ being continuous, this is typically meant to mean that there exists an element of the equivalence class $u_c \in u$ such that $u_c$ is a continuous function on $\Omega$ with finite $k,p$ Sobolev norm. Therefore, the set inclusion $u\in C^\infty_0(\Omega)$ reads "the equivalence class $u\in W^{k,p}(\Omega)$ contains an element $u_c$ such that $u_c\in C^\infty_c(\Omega).$"
Since the Sobolev space only cares about function up to a set of measure zero, we could ask questions about whether functions in the space are continuous, strongly differentiable, etc., but those questions are not invariant under modifications on a set of measure zero, so they can only be answered by seeing if there are sufficiently smooth elements of the equivalence class for which these properties apply. Once you have established that such a smooth function $u_c$ exists within an equivalence class $u$, you can then consider pointwise values of $u_c$ and perform classical oeprations on them, like evaluation and strong differentiation.
For the last question about the trace operator, we say that $u\in W^{1,p}(\Omega )\cap C(\overline{\Omega})$ if $u\in W^{1,p}(\Omega)$ contains an element $u_c\in u$ such that $u_c\in C(\overline{\Omega})$. For these functions, $u|_{\partial\Omega}$ is defined to be $u_c|_{\partial\Omega}$ and this defines the trace operator $Tu := u_c|{\partial\Omega}$. However, for a general function $u\in W^{1,p}(\Omega)$ that may not have such a continuous element, $u|_{\partial\Omega}$ is defined to be the limit $\lim_{m\to\infty}Tu_m$, where $u_m\in C^\infty (\overline{\Omega})$ and $\{u_m\}_{m=1}^\infty$ converges to $u$ in $W^{1,p}(\Omega)$. One can then show that $\{Tu_m\}_{m=1}^\infty$ is a Cauchy sequence in $L^p(\partial\Omega)$, so $Tu\in L^p(\partial\Omega)$, which are equivalence classes of functions on the boundary. Here instead of starting with the $L^p$ space and selecting continuous elements, we had to complete the space of continuous functions on the boundary formed by the elements of the Cauchy sequence $\{Tu_m\}_{m=1}^\infty$ so that our function space on the boundary contained their limit point, which necessitated the use of equivalence classes.
Best Answer
If $p\le n$ then we have these trace theorem for some $q<\infty$. If $p>n$ then $W^{1,p}$ is embedded in spaces of (Hoelder) continuous functions, for which traces exist as restrictions to the boundary. Hence these cases are not discussed.