Entropy solution of particular inviscid Burgers equation I need to find entropy solution for the inviscid Burgers equation $$u_{t}+uu_{x}=0$$ in $\mathbb{R}\times[0,+\infty)$ with initial condition $$u(x,0)=g(x)=-x\chi_{[a,b]}(x)$$where$\chi_{[a,b]}(x)$ stands for characteristic function of $[a,b]$, with $a,b\in\mathbb{R}$ and $a$ strictly smaller than $b$.
For a given $x_{0}\in\mathbb{R}$ characteristic curve passing through $(x_{0},0)$ has the equation $$x(t)=g(x_{0})t+x_{0}$$
which means that for $x_{0}\in(-\infty,a)\cup(b,+\infty)$ characteristic curves passing through $(x_{0},0)$ have the equation $$x(t)=x_{0}$$ Characteristics that pass through $(x_{0},0)$ for $x_{0}\in[a,b]$ have the equation $$x(t)=-x_{0}t+x_{0}=x_{0}(1-t)$$
Upper relation implies that every such characteristic passes through $(0,1)$. Therefore, in triangle with vertices $(a,0)$, $(b,0)$ and $(0,1)$ we can set $u(x,t)=\frac{x}{t-1}$ ($u$ defined this way satisfies equation and initial condition). It seems to me that, in order to find entropy solution in other regions, one need to consider three cases:
(i) $a\geq0$
; (ii) $b\leq0$ and (iii) $a$ smaller than $0$ and $b$ greater than $0$. How to proceed further? I will appreciate any kind of help.
 A: It is instructive to plot the characteristics for some representative choice of $a, b$ to get the intuition, where I always chose $a, b\neq 0$ to have the most general case.
Case (i), $0 \leq a < b$:

There is a lot going on, namely we have a shock forming at $x = a$ (for $a > 0$), a rarefaction fan "fanning out" at $ x = b$ and intersecting characteristics at $t=1$.
Based on the this solution for a similar problem, we can give a solution for $t \leq 1$ which is made of "base" solutions.
First, tackle the rarefaction in the area between the green and orange characteristics.
This can be taken straight from the books and turns out in this case to be
$$ u_{\color{green}G\color{orange}O} = \begin{cases} \frac{-x}{1-t} & x \leq b - bt = b(1 -t) \\ \frac{x - b}{t} & b -bt < x \leq b \\ 0 & x > b \end{cases} $$
Let's do a quick sanity check if this is so far correct:
On the left side $\big($ on curve $x = b(1-t)\big)$ we have
$$\frac{-x}{1-t} = \frac{-b(1-t)}{1-t} = -b \overset{!}{=} \frac{x - b}{t} = \frac{b(1-t) - b}{t} = -b \quad \checkmark $$ and on the right $( x = b )$ we obviously have $0 = 0$.
Now we have to turn our attention to the shock. The Rankine-Hugoniot condition determines the ODE for the shock curve. The left state $u_L$ is identically $0$, while the right state $u_R$ depends on current location $x$ and time $t$. Luckily, we already know the equation for this: $$u = \frac{-x}{1-t}.$$
Now we have to solve the ODE
$$ \dot x_s(t) = s(t) \overset{\text{RH for Burgers}}{=} 0.5 (u_L + u_R) = 0.5  \frac{x}{t - 1}, \quad x_s(0) \overset{!}{=} a.$$
Solving this separable ODE gives (cf. this answer)
$$ x_s(t) = a \sqrt{1-t}.$$
Finally we can set up the solution for $t < 1$:
$$ u(x, t) = \begin{cases} 0 & x \leq a \sqrt{1-t} \\ 
\frac{-x}{1-t} & a \sqrt{1-t} < x \leq b (1 -t) \\
\frac{x - b}{t} & b -bt < x \leq b \\ 0 & b < x \end{cases}. $$
Alright, now what's happening for $t> 1$? As seen from the plot, the information from the non-trivial initial condition is only implicitly prevalent through the rarefaction fan. $($The green characteristics intersect at $t= 1)$. The outermost wave of the fan carries value
$$ \widetilde{u_R}= \frac{x - b}{t}. $$
Again, we use the Rankine-Hugoniot condition to come up with the ODE for the shock:
$$ \dot{\widetilde{x_s}} = 0.5\frac{\widetilde{x_s} - b}{t}, \quad \widetilde{x_s}(1) = 0. $$
The shock curve is in this case given by
$$\widetilde{x_s}(t) = b (1 - \sqrt{t})$$
and the solution for $t > $ is given by
$$u(x, t) = \begin{cases} 0 & x \leq \widetilde{x_s}(t) = b (1 -\sqrt{t}) \\
\frac{x - b}{t} & b (1 -\sqrt{t}) < x \leq b \\
0 & x > b \end{cases} $$
For $a= 0$ you have the simplification that there is no shock for $t < 1$, you should be able to come up with a solution based on this approach and the previously mentioned solution.
Case (ii), $ a < b \leq 0$:

Now the rarefaction is between blue and green and the shock between green and orange. Essentially doing everything the same mutatis mutandis, the solution for $t < 1$ is
$$ u(x, t)  = \begin{cases} 0 & x \leq a \\
\frac{x-a}{t} & a < x \leq a(1-t) \\
\frac{-x}{1-t} & a(1-t) < x \leq b \sqrt{1-t} \\
0 & b \sqrt{1-t} < x \end{cases}$$
For $t > 1$,
$$ u(x, t) = \begin{cases} 0 & x \leq a \\ \frac{x-a}{t} & a < x \leq a(1 - \sqrt{t}) \\ 0 & a(1 - \sqrt{t})  < x\end{cases}$$
Case (iii) $a < 0 < b$:

Here we have two rarefactions, and no shock (for small times).
For $t < 1$,
$$u(x, t) = \begin{cases} 0 & x \leq a \\
\frac{x -a }{t} & a < x \leq a(1-t)\\
\frac{-x}{1-t} & a(1-t) < x \leq b(1-t) \\
\frac{x -b }{t} & b(1-t) < x \leq b \\
0 & b < x
\end{cases} $$
For $t > 1$, we have a shock forming from the two rarefaction waves. In this case,
$$ \dot{\widehat{x_s}}(t) = 0.5 \bigg( \frac{x -a }{t} + \frac{x -b }{t} \bigg) , \quad \widehat{x_s}(1) \overset{!}{=} 0 $$
with solution
$$ \widehat{x_s}(t) = 0.5 \big(a(1-t) + b(1-t)\big) $$
Thus, for $t > 1$:
$$u(x, t) = \begin{cases} 0 & x \leq a \\
\frac{x -a }{t} & a < x \leq 0.5 \big(a(1-t) + b(1-t)\big) \\
\frac{x -b }{t} & 0.5 \big(a(1-t) + b(1-t)\big) < x \leq b \\
0 & b < x \end{cases} $$
