Firstly, Let's use characteristic coordinates \begin{equation}\left\{\begin{aligned}&\xi=x+ct,\\&\eta=x-ct.\end{aligned}\right.\label{eq1}\end{equation} When using the characteristic coordinates, the problem become: \begin{gather}u_{\xi\eta}=0\qquad \text{as }\xi>0,\eta>0,\\[3pt]u|_{\xi=0}=g(t)\qquad \text{as }t<0 ,\\[3pt]u|_{\eta=0}=h(t)\qquad \text{as } t>0.\end{gather} Then by 2.4.1 equation(4), we have \begin{equation}u=\phi(\xi)+\psi(\eta)\label{5}\end{equation} is the general solution to (2). Then \begin{equation}u|_{\xi=0}=\phi(0)+\psi(\eta)=g(t)\end{equation} \begin{equation}u|_{\eta=0}=\phi(\xi)+\psi(0)=h(t)\end{equation} Thus by (5)(6)(7) \begin{equation}u=g(t)+h(t)-\phi(0)-\psi(0)\end{equation} Since we have \begin{equation}u(0,0)=\phi(0)+\psi(0)\end{equation} \begin{equation}u(0,0)=h(0)=g(0)\end{equation} Then \begin{equation}u=g(t)+h(t)-g(0)\end{equation} solves Goursat problem.