Solution (source code)

= Solution

The exterior characteristics give $u=0$ for $x<0$ and $u=1$ for $x>t$. In the gap put $\xi=x/t$ and $u=f(\xi)$. The <Inviscid Burgers equation> becomes $(f-\xi)f'=0$. Matching the increasing states selects the <rarefaction wave> $f(\xi)=\xi$, so
$$
\boxed{u(x,t)=\begin{cases}0,&x\leq0,\\x/t,&0<x<t,\\1,&x\geq t.\end{cases}}
$$
It is continuous and piecewise smooth at positive times and satisfies the <entropy> condition. A discontinuous shock joining the same increasing states would be nonentropic.