[proofplan]
The proof has two directions. If $u$ satisfies the equation pointwise, [integration by parts](/theorems/210) against an arbitrary compactly supported smooth [test function](/page/Test%20Function) converts $-\Delta u=f$ into the weak identity. Conversely, if the weak identity holds, then the [continuous function](/page/Continuous%20Function) $-\Delta u-f$ has zero integral against every compactly supported smooth test function. A bump-function argument shows that such a continuous function must vanish pointwise on $U$.
[/proofplan]
[step:Convert the classical equation into the weak identity by integration by parts]
Assume first that $u$ is a classical solution of $-\Delta u=f$ in $U$. Let
\begin{align*}
\phi: U \to \mathbb{R}
\end{align*}
be an arbitrary test function with $\phi \in C_c^\infty(U)$, and let $K := \operatorname{supp}\phi \subset U$ denote its compact support. Since $u \in C^2(U)$ and $\phi \in C_c^\infty(U)$, for each $i \in \{1,\dots,n\}$ the function
\begin{align*}
x \mapsto \phi(x)\,\partial_{x_i}u(x)
\end{align*}
is $C^1$ and compactly supported in $U$. Therefore its integral derivative in the $x_i$ direction is zero:
\begin{align*}
\int_U \partial_{x_i}\bigl(\phi(x)\,\partial_{x_i}u(x)\bigr)\, d\mathcal{L}^n(x) = 0.
\end{align*}
Expanding the derivative by the product rule gives
\begin{align*}
\int_U \partial_{x_i}\phi(x)\,\partial_{x_i}u(x)\, d\mathcal{L}^n(x) + \int_U \phi(x)\,\partial_{x_i}^2u(x)\, d\mathcal{L}^n(x) = 0.
\end{align*}
Hence
\begin{align*}
\int_U \partial_{x_i}u(x)\,\partial_{x_i}\phi(x)\, d\mathcal{L}^n(x) = -\int_U \phi(x)\,\partial_{x_i}^2u(x)\, d\mathcal{L}^n(x).
\end{align*}
Summing over $i=1,\dots,n$ yields
\begin{align*}
\int_U \nabla u(x)\cdot \nabla \phi(x)\, d\mathcal{L}^n(x) = \int_U \bigl(-\Delta u(x)\bigr)\phi(x)\, d\mathcal{L}^n(x).
\end{align*}
Since $-\Delta u=f$ pointwise on $U$, this becomes
\begin{align*}
\int_U \nabla u(x)\cdot \nabla \phi(x)\, d\mathcal{L}^n(x) = \int_U f(x)\phi(x)\, d\mathcal{L}^n(x).
\end{align*}
Because $\phi \in C_c^\infty(U)$ was arbitrary, $u$ is a weak solution.
[guided]
Assume that $u$ is a classical solution. This means that the pointwise identity
\begin{align*}
-\Delta u(x)=f(x)
\end{align*}
holds for every $x \in U$. To prove that $u$ is a weak solution, we must show the weak identity for an arbitrary test function. Let
\begin{align*}
\phi: U \to \mathbb{R}
\end{align*}
be any function in $C_c^\infty(U)$, and let $K:=\operatorname{supp}\phi$. The compact support condition matters because it removes boundary terms: all integrations by parts happen inside a compact subset of $U$.
Fix an index $i \in \{1,\dots,n\}$. Since $u \in C^2(U)$, the partial derivative $\partial_{x_i}u$ is $C^1$ on $U$. Since $\phi \in C_c^\infty(U)$, the product
\begin{align*}
x \mapsto \phi(x)\,\partial_{x_i}u(x)
\end{align*}
is a compactly supported $C^1$ function on $U$. The integral of its $x_i$ derivative over $U$ is zero, because the compact support lies away from the boundary of $U$:
\begin{align*}
\int_U \partial_{x_i}\bigl(\phi(x)\,\partial_{x_i}u(x)\bigr)\, d\mathcal{L}^n(x) = 0.
\end{align*}
Expanding the derivative gives
\begin{align*}
\partial_{x_i}\bigl(\phi\,\partial_{x_i}u\bigr)=\partial_{x_i}\phi\,\partial_{x_i}u+\phi\,\partial_{x_i}^2u.
\end{align*}
Substituting this identity into the integral gives
\begin{align*}
\int_U \partial_{x_i}\phi(x)\,\partial_{x_i}u(x)\, d\mathcal{L}^n(x) + \int_U \phi(x)\,\partial_{x_i}^2u(x)\, d\mathcal{L}^n(x)=0.
\end{align*}
Rearranging, we obtain
\begin{align*}
\int_U \partial_{x_i}u(x)\,\partial_{x_i}\phi(x)\, d\mathcal{L}^n(x) = -\int_U \phi(x)\,\partial_{x_i}^2u(x)\, d\mathcal{L}^n(x).
\end{align*}
Now sum this identity over all coordinate directions $i=1,\dots,n$. The left-hand side becomes the gradient [inner product](/page/Inner%20Product), and the right-hand side becomes the negative Laplacian:
\begin{align*}
\int_U \nabla u(x)\cdot \nabla \phi(x)\, d\mathcal{L}^n(x) = \int_U \bigl(-\Delta u(x)\bigr)\phi(x)\, d\mathcal{L}^n(x).
\end{align*}
Finally, the classical equation says $-\Delta u=f$ pointwise, so the last display becomes
\begin{align*}
\int_U \nabla u(x)\cdot \nabla \phi(x)\, d\mathcal{L}^n(x) = \int_U f(x)\phi(x)\, d\mathcal{L}^n(x).
\end{align*}
This is exactly the weak formulation, and since $\phi$ was arbitrary, $u$ is a weak solution.
[/guided]
[/step]
[step:Reduce the weak formulation to vanishing of a continuous test-distribution]
Assume conversely that $u$ is a weak solution. Define
\begin{align*}
g: U &\to \mathbb{R}
\end{align*}
by
\begin{align*}
g(x) := -\Delta u(x)-f(x).
\end{align*}
Since $u \in C^2(U)$ and $f \in C(U)$, the function $g$ is continuous on $U$.
Let $\phi \in C_c^\infty(U)$. By the same compact-support [integration by parts](/theorems/2098) identity proved in the previous step,
\begin{align*}
\int_U \nabla u(x)\cdot \nabla \phi(x)\, d\mathcal{L}^n(x) = \int_U \bigl(-\Delta u(x)\bigr)\phi(x)\, d\mathcal{L}^n(x).
\end{align*}
The weak formulation also gives
\begin{align*}
\int_U \nabla u(x)\cdot \nabla \phi(x)\, d\mathcal{L}^n(x) = \int_U f(x)\phi(x)\, d\mathcal{L}^n(x).
\end{align*}
Subtracting the two identities gives
\begin{align*}
\int_U g(x)\phi(x)\, d\mathcal{L}^n(x)=0
\end{align*}
for every $\phi \in C_c^\infty(U)$.
[/step]
[step:Use nonnegative bump functions to force the continuous residual to vanish]
We prove that $g(x)=0$ for every $x \in U$. Suppose, for contradiction, that there exists $x_0 \in U$ with $g(x_0)>0$. Since $g$ is continuous, there is $r>0$ such that $B(x_0,r)\subset U$ and
\begin{align*}
g(x) \geq \frac{g(x_0)}{2}
\end{align*}
for every $x \in B(x_0,r)$.
Choose a function
\begin{align*}
\psi: U \to [0,\infty)
\end{align*}
with $\psi \in C_c^\infty(U)$, $\operatorname{supp}\psi \subset B(x_0,r)$, and
\begin{align*}
\int_U \psi(x)\, d\mathcal{L}^n(x)>0.
\end{align*}
Then
\begin{align*}
0=\int_U g(x)\psi(x)\, d\mathcal{L}^n(x)=\int_{B(x_0,r)} g(x)\psi(x)\, d\mathcal{L}^n(x).
\end{align*}
Using $g(x)\ge g(x_0)/2$ and $\psi(x)\ge 0$ on $B(x_0,r)$ gives
\begin{align*}
\int_{B(x_0,r)} g(x)\psi(x)\, d\mathcal{L}^n(x)\ge \frac{g(x_0)}{2}\int_{B(x_0,r)} \psi(x)\, d\mathcal{L}^n(x)>0,
\end{align*}
a contradiction. Therefore no point with $g(x_0)>0$ exists.
The same argument applied to $-g$ rules out a point $x_0 \in U$ with $g(x_0)<0$. Hence $g(x)=0$ for every $x \in U$.
[/step]
[step:Conclude the pointwise Poisson equation]
Since $g(x)=0$ for every $x \in U$ and $g(x)=-\Delta u(x)-f(x)$ by definition, we have
\begin{align*}
-\Delta u(x)=f(x)
\end{align*}
for every $x \in U$. Thus $u$ is a classical solution of $-\Delta u=f$ in $U$. Combining this with the first direction proves the equivalence.
[/step]