weak solution of linear transport (advection) equation How to show that $g(x-at)$ is the weak solution of the initial value problem
$$u_t+au_x=0$$
$$u(x,0)=g(x)$$ where $ g(x)\in L^{\infty}(\mathbb{R})$
Definition: $u$ is said to be the weak solution of the above initial value problem if
$$\int\limits_0 ^ {\infty} \int\limits_{\mathbb{R}} ({u{\phi}_t+au{\phi}_x})dxdt =\int\limits_{\mathbb{R}}g(x)\phi(x,0)dx$$  $\forall \phi \in C_c ^1(\mathbb{R} \times[0,\infty))$
 A: Let us make the change of variable $(\xi, \tau) = (x-at,t)$, in other words $(x,t) = (\xi + a\tau,\tau)$, so that
\begin{aligned}
&\phi_t = \phi_\xi \xi_t + \phi_\tau \tau_t = \phi_\tau - a\phi_\xi \\
&\phi_x = \phi_\xi \xi_x + \phi_\tau \tau_x = \phi_\xi \, .
\end{aligned}
Thus, using Fubini's theorem and integration by parts,
\begin{aligned}
\iint_{\Bbb R\times\Bbb R_+} u\, (\phi_t + a \phi_x)\, \text d x\,\text d t
&= \iint_{\Bbb R\times\Bbb R_+} u \phi_\tau\, \text d \xi\,\text d \tau \\
&= \iint_{\Bbb R_+\times\Bbb R} u \phi_\tau\, \text d \tau\,\text d \xi \\
&= \int_{\Bbb R}\left[u\phi\right]_{\tau\in\Bbb R_+}\text d\xi - \iint_{\Bbb R_+\times\Bbb R} \underbrace{u_\tau}_{u_t + au_x =0} \phi\, \text d \tau\,\text d \xi \\
&= -\int_{\Bbb R}\left.(u\phi)\right|_{t = 0}\text dx \, .
\end{aligned}
We have shown that the definition holds for all smooth $\phi$ with compact support. Hence, $u(x,t) = g(x-at)$ is a weak solution to the Cauchy problem of the advection equation. Note that there is a sign mistake in OP.

Note that $u$ does not need to be continuous to apply integration by parts as above (see Wikipedia article, §Extension to other cases, and Wikipedia article, §A concrete example).
A: The change of variable can also be justified as follows:
Let $\Omega$ be an open set, $\Psi: \Omega \rightarrow \Psi(\Omega)$ be a $C^{\infty}$ diffeomorphism and $f:\Psi(\Omega) \rightarrow \mathbb{R}$ be a measureble function. Then the change of variable formula is given by
\begin{eqnarray}\label{CVF}
\int\limits_{\Psi(\Omega)}f(x)dx=\int\limits_{\Omega}f(\Psi(x)) |J_{\Psi}(x)|dx             \quad \quad \quad (1)
\end{eqnarray}
Now, we apply the above formula with $\Omega=\mathbb{R}\times \mathbb{R}^+$  and  $\Psi(x,t)=(x+at,t)$ so that $|J_{\Psi}(x)|=1,$ as below.
Consider
\begin{eqnarray}
&&\int\limits_{\mathbb{R}\times \mathbb{R}^+}u(x,t)(D_2\phi(x,t)+aD_1\phi(x,t))dxdt\\
&&=\int\limits_{\mathbb{R}\times \mathbb{R}^+}g(x-at)(D_2\phi(x,t)+aD_1\phi(x,t))dxdt\\
&&= \int\limits_{\mathbb{R}\times \mathbb{R}^+}g(x)(D_2\phi(x+at,t)+aD_2\phi(x+at,t))dxdt \quad \because (1) \\
&&= \int\limits_{\mathbb{R}\times \mathbb{R}^+}g(x)(\partial_t \tilde{\phi}(x,t))dxdt  \quad \quad \quad \quad \quad \quad\quad \quad\quad \quad \because \tilde{\phi}(x,t):=\phi(x+at,t) \\
&&= -\int\limits_{\mathbb{R}}g(x)\tilde{\phi}(x,0)dx = -\int\limits_{\mathbb{R}}u(x,0)\phi(x,0)dx.   \quad\quad \because \text{Fundamental theorem of Calculus}
\end{eqnarray}
This implies that $u(x,t)=g(x-at)$ satisfies the weak formulation.
