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))$
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).