I managed to understand the method of characteristics to get the solution of the transport equation. However, I am getting stucked finding the final solution for the Burgers' equation $u_t + u u_x = 0$ given the following initial solution
$$ u_0(x) = \begin{cases} 0, & x < -1 \\ 1+x, & -1 < x < 0 \\ 1-x, & 0 < x < 1 \\ 0, & 1 < x \\ \end{cases} $$
The solution I get is of the form
$$u(x,t) = u(x-u_0(x)t)$$
and according to my calculations this gives
$$ u(x,t) = \begin{cases} 0, & x < -1 \\ (1+x)(1-t), & -1 < x < \frac{t}{1-t} \\ (1-x)(1+t) & \frac{t}{1+t} < x < 1 \\ 0, & 1 < x \\ \end{cases} $$
which does not matches with the correct answer in my notes. Can anyone explain me how to do this correctly?