Suppose $\Omega$ is a bounded open and connected set in $\mathbb R^n$, $C\subseteq \Omega$ is a compact subset and $1<p<\infty$. Does the following equality hold: $$L^p(C) = \{f|_{C}:f\in L^p(\Omega)\}?$$
My thoughts: Since $$\int_C |f|_C|^p=\int_C|f|^p\leq \int_\Omega |f|^p,$$ so the reverse inclusion holds. However, I'm not sure how to prove/disprove about the forward inclusion.
If $f \in L^{p}(C)$ define $g=f$ on $C$ and $0$ on $\Omega \setminus C$. Then $g \in L^{p}(\Omega)$ and $f=g|_C$.