PDE: solve IVP where $u_{t} +3u u _{x} = 0$, $u(0,x) = \left \{ \begin{matrix} 2, x < 1 \\ 0, x>1 \end{matrix} \right.$ I just started learning PDEs and I am at the very beginning of the book by Peter J. Olver. Now when I search in the stackexchange I found similar problems, all relating to Cauchy or Burger equations. The book so far has not spoken of these, so I guess I should be able to solve this without knowledge of them.

I am asked to solve the IVP where
$$u_{t} +3u u _{x} = 0, \quad \quad u(0,x) = \left \{ \begin{matrix} 2, x < 1 \\  0, x>1 \end{matrix} \right.$$
My reasoning (likely to be wrong) so far is the following: we have a non-linear transport equation, where the speed of the wave is dictated by $3u$ (i.e. the wave is moving faster the bigger it is). We also know the solution is constant along the characteristic curve. We can see the wave being constant at $x>1$ but moving to the right when $x<1$. This leads me to the following:
$$
\begin{align}
\frac{ \partial x}{\partial t} &= 3u \\
\frac{\partial u }{\partial t} &= 0 \\
u(0,x) &= f(x),
\end{align}
$$
Then $u(t,x) = f(x_{0})$ and now I am stuck. I do not know how to proceed.

Any suggestions or comments on my train of thought or on how to proceed would be much appreciated.
 A: Not quite, but part of it is correct. In fact, the method of characteristics giving
$$ [{\bf wrong!}]\qquad u(t,x) = \left\lbrace
\begin{aligned}
&2, & &x<1+6t \\
&0, & &x>1
\end{aligned}\right.
$$
is only valid until the characteristic curves meet the shock wave (which already develops at time $t=0$ here). Since shock wave solutions are discontinuous, they cannot be differentiated in space and time. Thus, solutions must be seeked in the weak sense. The procedure for solving PDE problems of this type, i.e. Riemann problems, is described here:
$$ u(t,x) = \left\lbrace
\begin{aligned}
&2, & &x<1+3t \\
&0, & &x>1+3t
\end{aligned}\right.
$$
A: After further reading I constructed the following:
We use a change of variables to find the characteristic curves and find
$$x = 3tf(y)+y.$$
We then have that $u(0,y)=2$ for $y<1$ and $u(o,y)=0$ for $y>1$. We can draw these lines in the $(x,t)$-plane and will find a triangular area of shock waves (i.e. multi valued solutions). Now by looking at two values of $y$ (one smaller and one larger than 1) we can easily derive
$$
u(t,x) = \left\{\begin{matrix}
2 & x-6t<1\\ 
0 & x>1
\end{matrix}\right.
$$
