[proofplan]
We construct a counterexample with the unweighted choice $w\equiv 1$, so the weighted [Sobolev space](/page/Sobolev%20Space) is the ordinary Sobolev space. The domain is the union of two open balls tangent at one boundary point, and the target Sobolev function is constant $0$ on one ball and constant $1$ on the other. This function has weak gradient zero because there is no interior interface, but smooth functions on the closure have a single value at the tangent point. Morrey's boundary continuity for $p>n$ forces any smooth Sobolev approximation to converge at that tangent point to both $0$ and $1$, giving a contradiction.
[/proofplan]
[step:Choose two tangent balls and the unweighted Sobolev norm]
Fix $n=2$ and $p=3$. Let $e_1=(1,0)\in\mathbb R^2$, and define the open balls
\begin{align*}
B_-:=B(-e_1,1), \qquad B_+:=B(e_1,1).
\end{align*}
Set
\begin{align*}
U:=B_-\cup B_+.
\end{align*}
Then $U\subset\mathbb R^2$ is open, $B_-\cap B_+=\varnothing$, and
\begin{align*}
\overline{B_-}\cap\overline{B_+}=\{0\}.
\end{align*}
Define the measurable weight $w:U\to(0,\infty)$ by $w(x)=1$ for all $x\in U$. Thus $w<\infty$ $\mathcal L^2$-a.e. and $W^{1,3}(U,w)=W^{1,3}(U)$ with the usual norm.
[/step]
[step:Define a Sobolev function with different component values]
Define
\begin{align*}
u:U&\to\mathbb R
\end{align*}
by setting $u(x)=0$ for $x\in B_-$ and $u(x)=1$ for $x\in B_+$. Since $B_-$ and $B_+$ are disjoint open components of $U$, the restrictions $u|_{B_-}$ and $u|_{B_+}$ are constant functions. Hence
\begin{align*}
\int_U |u|^3\,d\mathcal L^2(x)<\infty
\end{align*}
because $U$ is bounded, and the weak gradient satisfies $\nabla u=0$ $\mathcal L^2$-a.e. in $U$.
Indeed, if $\varphi\in C_c^\infty(U)$ and $i\in\{1,2\}$, then $\varphi|_{B_-}\in C_c^\infty(B_-)$ and $\varphi|_{B_+}\in C_c^\infty(B_+)$. Since constants have zero [weak derivative](/page/Weak%20Derivative) on each ball,
\begin{align*}
\int_U u\,\partial_{x_i}\varphi\,d\mathcal L^2(x)
=
\int_{B_+}\partial_{x_i}\varphi\,d\mathcal L^2(x)
=
0.
\end{align*}
Thus $\partial_{x_i}u=0$ in the weak sense on $U$ for each $i$, so $u\in W^{1,3}(U)$.
[/step]
[step:Use Morrey boundary continuity on each ball]
Assume, for contradiction, that $C^\infty(\overline U)\cap W^{1,3}(U)$ is dense in $W^{1,3}(U)$. Then there exists a sequence $(u_k)_{k=1}^{\infty}$ in $C^\infty(\overline U)\cap W^{1,3}(U)$ such that
\begin{align*}
\|u_k-u\|_{W^{1,3}(U)}\to 0.
\end{align*}
Restricting the norm to each component gives
\begin{align*}
\|u_k\|_{W^{1,3}(B_-)}\to 0
\end{align*}
and
\begin{align*}
\|u_k-1\|_{W^{1,3}(B_+)}\to 0.
\end{align*}
We apply [Morrey's Inequality](/theorems/62) on the bounded Lipschitz domains $B_-$ and $B_+$. Since $p=3>2=n$, the theorem gives continuous representatives on the closures and, in particular, bounded point-evaluation maps at the boundary point $0$. Therefore there are constants $C_->0$ and $C_+>0$ such that for every $v\in W^{1,3}(B_-)$ with continuous representative $\widetilde v\in C(\overline{B_-})$,
\begin{align*}
|\widetilde v(0)|\le C_-\|v\|_{W^{1,3}(B_-)}
\end{align*}
and for every $v\in W^{1,3}(B_+)$ with continuous representative $\widetilde v\in C(\overline{B_+})$,
\begin{align*}
|\widetilde v(0)|\le C_+\|v\|_{W^{1,3}(B_+)}.
\end{align*}
Applying the first estimate to $v=u_k|_{B_-}$ gives
\begin{align*}
|u_k(0)|\le C_-\|u_k\|_{W^{1,3}(B_-)}\to 0.
\end{align*}
Applying the second estimate to $v=u_k|_{B_+}-1$ gives
\begin{align*}
|u_k(0)-1|\le C_+\|u_k-1\|_{W^{1,3}(B_+)}\to 0.
\end{align*}
[guided]
The important point is that convergence in $W^{1,3}$ on either ball controls the boundary value at the tangent point. This is not an interior-ball argument around $0$, because no open ball centered at $0$ lies inside $U$. Instead we work separately on the two smooth pieces $B_-$ and $B_+$.
We first restrict the assumed convergence to the left ball. Since the Sobolev norm on $U=B_-\cup B_+$ is the sum of the component contributions, the convergence
\begin{align*}
\|u_k-u\|_{W^{1,3}(U)}\to 0
\end{align*}
implies
\begin{align*}
\|u_k-u\|_{W^{1,3}(B_-)}\to 0.
\end{align*}
But $u=0$ on $B_-$, so this is exactly
\begin{align*}
\|u_k\|_{W^{1,3}(B_-)}\to 0.
\end{align*}
Similarly, since $u=1$ on $B_+$, we get
\begin{align*}
\|u_k-1\|_{W^{1,3}(B_+)}\to 0.
\end{align*}
Now we use [Morrey's Inequality](/theorems/62). Its hypotheses are satisfied on each component: $B_-$ and $B_+$ are bounded Lipschitz domains in $\mathbb R^2$, and the exponent is $p=3>2=n$. Morrey's theorem gives a continuous representative on the closure of each ball, and point evaluation at any point of the closure is a bounded linear functional on $W^{1,3}$ for that ball. In particular, there are constants $C_->0$ and $C_+>0$ such that
\begin{align*}
|\widetilde v(0)|\le C_-\|v\|_{W^{1,3}(B_-)}
\end{align*}
for $v\in W^{1,3}(B_-)$ and
\begin{align*}
|\widetilde v(0)|\le C_+\|v\|_{W^{1,3}(B_+)}
\end{align*}
for $v\in W^{1,3}(B_+)$.
Because each $u_k$ lies in $C^\infty(\overline U)$, it has one continuous value at the shared closure point $0\in\overline{B_-}\cap\overline{B_+}$. Thus the continuous representative of $u_k|_{B_-}$ takes the value $u_k(0)$ at $0$, and the continuous representative of $u_k|_{B_+}$ takes the same value $u_k(0)$ at $0$. Applying the left estimate to $u_k|_{B_-}$ yields
\begin{align*}
|u_k(0)|\le C_-\|u_k\|_{W^{1,3}(B_-)}\to 0.
\end{align*}
Applying the right estimate to $u_k|_{B_+}-1$ yields
\begin{align*}
|u_k(0)-1|\le C_+\|u_k-1\|_{W^{1,3}(B_+)}\to 0.
\end{align*}
So the same real number sequence $(u_k(0))$ must converge both to $0$ and to $1$.
[/guided]
[/step]
[step:Derive the contradiction from the single shared boundary value]
From the left component estimate,
\begin{align*}
u_k(0)\to 0.
\end{align*}
From the right component estimate,
\begin{align*}
u_k(0)\to 1.
\end{align*}
A real sequence has at most one limit, so this is impossible. Therefore no sequence in $C^\infty(\overline U)\cap W^{1,3}(U)$ can converge to $u$ in $W^{1,3}(U)$.
Since $w\equiv 1$, this says precisely that
\begin{align*}
C^\infty(\overline U)\cap W^{1,3}(U,w)
\end{align*}
is not dense in $W^{1,3}(U,w)$. This proves the existential statement.
[/step]