I want to show the following statement ($1 \leq p < \infty$), for an open interval $I$:
If $u \in W^{1,p}\left(I\right) \bigcap C_c\left(I\right)$ then $u \in W_{0}^{1,p}\left(I\right) $.
$W^{1,p}\left(I\right) $ is the Sobolev Space, i.e. the space consisting of the functions that are in $L^p\left(I\right)$ with one (weak) derivative in $L^p\left(I\right)$ and $1 \leq p < \infty$ . $W_{0}^{1,p}\left(I\right) $ is the closure of $C_c^1\left(I\right)$ in $W^{1,p}\left(I\right) $. $C_c\left(I\right)$ is the set of the compactly supported functions defined on the interval $I \subset \mathbb{R}$.
The norm for an element $u \in W^{1,p}\left(I\right)$ is $\left\|u\right\|=\left\|u\right\|_p + \|u'\|_p$.
So this is equivalent to show that for every u in $ W^{1,p}\left(I\right) \bigcap C_c\left(I\right)$ there is a sequence $\left\lbrace u_n\right\rbrace_{n \in \mathbb{N}}$ in $C^1_{c}\left(I\right)$ such that $\left\lbrace u_n\right\rbrace \to u$ in the norm $\left\|\cdot\right\|$.
I have considered using mollifiers, I have already shown that if $f \in L^p(\mathbb{R})$, then $\left\lbrace\rho_n*f\right\rbrace\to f $ in $L^p(\mathbb{R})$ for a sequence $\left\lbrace\rho_n\right\rbrace$ of mollifiers. I do not know how to adapt this result for interval $I \subset \mathbb{R}$.
The following two theorems (see Partial Differential Equations (chapter 5) by Evans) can answer your question: