Weak formulation for nonhomogeneous problem $-\Delta u = 0$ I am wondering about the definition of weak solution to the nonhomogeneous problem
$$-\Delta u = 0 \text{ in }\Omega$$
$$u = g \text{ in }\partial\Omega$$
given $g \in H^{\frac 12}(\partial\Omega)$.
It should be something like: $u \in H^1(\Omega)$ satisfies
$$\int_\Omega \nabla u \nabla v - \int_{\partial\Omega} v \partial_\nu u = 0\quad\text{for all $v \in H^1(\Omega)$}\tag{1}$$
and $\gamma(u) = g$ where $\gamma$ is the trace operator. Edit: as suggested by Tomas, the normal derivative is not defined for $H^1$ functions. So I am not sure what the natural weak formulation should be for this problem. I could test with $H^1_0$ functions instead, but this seems unnatural and we obtain a mixed bilinear form.

Let $G$ extend $g$, and consider the homogeneous problem
$$-\Delta w = \Delta G \text{ in }\Omega$$
$$w = 0 \text{ in }\partial\Omega$$
This is well-posed via Lax-Milgram and we have $w \in H^1_0(\Omega)$ such that
$$\int_\Omega \nabla w \nabla \varphi = -\int_\Omega \nabla G \nabla \varphi$$
for all $\varphi \in H^1_0(\Omega)$.
So then set $u=w+G \in H^1(\Omega)$, then $\gamma(u) = g$ and $u$ satisfies
$$\int_\Omega \nabla u\nabla \varphi = 0\quad\text{for all $\varphi \in H^1_0(\Omega)$.}$$

How do I reconcile this with what I think should be the weak form $\text{(1)}$? Notice the different spaces the test functions lie in.
 A: First we look for a distributional solution. Remember that, as an distribution, $\Delta u$ is defined by $$\langle\Delta u,v \rangle=-\langle\nabla u,\nabla v\rangle,\ \forall\ v\in C_0^\infty(\Omega). \tag{1}$$
From $(1)$, we can say that a solution in the distributional sense, is a function $u\in H^1(\Omega)$ with $Tu=g$ satisfying $$\int_\Omega \nabla u\nabla v=0,\ \forall\ v\in C_0^\infty(\Omega). \tag{2}$$
By density we may conclude from $(2)$ that $$\int_\Omega \nabla u\nabla v=0,\ \forall v\in H_0^1(\Omega). \tag{3}$$
This is not the only weak formulation for this problem, however, it is the one which comes from a variational problem, to wit, let $F:\{u\in H^1(\Omega):\ Tu=g \}\to \mathbb{R}$ be defined by $$Fu=\frac{1}{2}\int_\Omega |\nabla u|^2.$$
Note that $(3)$ can be rewritten as $$\langle F'(u),v\rangle=0,\ \forall\ v\in H_0^1(\Omega). \tag{4}$$
Also note that, once $\{u\in H^1(\Omega):\ Tu=g \}$ is a closed convex set of $H^1(\Omega)$ and $F$ is a coercive, weakly lower semi continuous function, we have that $F$ has a unique global minimum which satisfies $(4)$.
By not considering any kind of derivative of $u$, you can also use another weak formulation: let $C_0^{1,\Delta}(\overline{\Omega})=\{u\in C_0^1(\overline{\Omega}):\ \Delta u \in L^\infty(\Omega)\}$. A "very" weak solution, is a function $u\in L^1(\Omega)$ satisfying $$\int_\Omega u\Delta v=-\int_{\partial\Omega}g\frac{\partial v}{\partial \nu },\ \forall\ v\in C_0^{1,\Delta}(\overline{\Omega}).$$
In your setting, I mean, when $g\in H^{1/2}(\Omega)$, it can be proved that both definitions are equivalent. For references, take a look in the paper Elliptic Equations Involving Measures from Veron. It has a PDF version here. Take a look in page 8.
To conclude, I would like to adress @JLA, which gave a comment in OP; in the end, what we really want is a $H^2$ function (or more regular), because we are working with the Laplacean and it is natural to have two derivatives. 
It can be proved, by using regularity theory, that $u$ is in fact in $H^2$, however, there is a huge difference between proving that $u$ is in $H^2$ after finding it in $H^1$ by the above methods and finding directly $u\in H^2(\Omega)$ by another method. Note, for example, that none of the methods above, does apply if we change $H_0^1(\Omega)$ by $H^2(\Omega)$.
A: From my experience, there are three types of Laplace equation PDEs, namely, (D) for Dirichlet problem
\begin{cases}\tag D
-\Delta u=f\\
u=0
\end{cases}
(N) for Neumann problem
\begin{cases}\tag N
-\Delta u=f\\
\partial_\nu u=0
\end{cases}
and (R) for Robin problem
\begin{cases}\tag R
-\Delta u=f\\
\partial_\nu u+\alpha u=0
\end{cases}
We use test function $v\in H_0^1$ for problem $(D)$ and $v\in H^1$ for problem $(N)$ and $(R)$. 
Let's first look at problem $(D)$. You already discovered that the problem 
\begin{cases}
-\Delta u=f\\
u=0
\end{cases}
and problem
\begin{cases}
-\Delta u=0\\
u=g
\end{cases}
are more or less the same thing. So let's focus on the first one. To get a sense what should be the proper test space, we assume we have a smooth solution $u\in H^1(\Omega)\cap C^\infty(\bar \Omega)$. Then by trace theorem, we have $u\in H_0^1(\Omega)$. Hence, if we ask to use Lax-Milgram, we need to fit test space with the desired properties of $u$, and hence the test space must be $H_0^1(\Omega)$. Finally the weak formulation 
$$ \int_\Omega \nabla u\cdot\nabla v=\int_\Omega fv\,\, \text{ for all }v\in H_0^1(\Omega)$$
will let us use Lax-Milgram.
Use the same way we say $H^1$ is the proper choice of $(N)$.
