Why $C_c^{\infty}(I)$ is not dense in $W^{1,p}(I)$ Suppose $I$ is an open interval (bounded or unbounded). It is stated that $C_c^{\infty}(I)$ is dense in $L^p(I)$, $1\leq p<\infty$. However $C_c^{\infty}(I)$ is not dense in $W^{1,p}(I)$, we only have the result  $C_c^{\infty}(\mathbb{R})|_{I}$ is dense in  $W^{1,p}(I)$. What is the reason for that ?
 A: By "what is the reason", you mean intuition? The jumps that we make  when approximating a $L^p$ function by $C^{\infty}_c$ ones can be made $L^p$-arbitrarily small, but for that we need to make pretty steep changes, which contribute heavily to a derivative, even in the $L^p$ sense.
For a more rigorous "reason", let $I=(0,1)$ and consider the embedding $\iota: W^{1,2}(I) \hookrightarrow C^0(I).$ Now, take $\phi_n \in C^{\infty}_c(I)$ and suppose they converge to a given $\phi$ in $W^{1,2}(I)$. Those $\phi_n$ are actually in $C^{\infty}_c(\mathbb{R})$, and since they converge uniformly to (the continuous representative of) $\phi$ in $(0,1)$ (the embedding is continuous) and it is obvious that they converge uniformly when seen as a function in the whole $\mathbb{R}$, the limit function is actually continuous in $\mathbb{R}$, and $\phi$ must satisfy $\lim\limits_{x \to 0}\phi(x)=0=\lim\limits_{x \to 1}\phi(x)$ due to the fact that the "extension" is always $0$ both on $0$ and $1$. So, any continuous function which is in $W^{1,2}(I)$ and does not satisfy that "boundary" condition is not in $\overline{C^{\infty}_c(I)}^{1,2}$.
PS: $C_c^{\infty}(\mathbb{R})$ is dense in $W^{k,p}(\mathbb{R})$. I know you implicitly say this, but since your phrasing "$C_c^{\infty}(I)$ is not dense in $W^{1,p}(I)$" suggests that it is always the case that is not dense, I thought it might be worthwhile to point this out explicitly.
