The variable $u$ is constant along the characteristic curves, which satisfy
\begin{aligned}
x'(t) & = u(x(t),t) \, ,
\\
& = u(x(0),0) \, .
\end{aligned}
Thus, the latter are straight lines in the $x$-$t$ plane, determined by the initial data. Here, the initial data is piecewise constant, i.e. we solve Riemann problems. As displayed in the figure below,
- characteristics separate in the vicinity of $x=0$, and a rarefaction wave occurs;
- characteristics cross in the vicinity of $x=1$, and a shock-wave occurs.
The rarefaction wave is a continuous self-similar solution, deduced from the self-similarity Ansatz $u (x,t)=v (\xi)$ with $\xi = x/t$. Indeed,
$$
\partial_t
u(x,t) + u(x,t)\, \partial_x u(x,t) = \left(v(\xi) - \xi\right) \frac{v'(\xi)}{t} \, ,
$$
and thus, $v(\xi) = \xi$ or $u(x,t) = x/t$.
The shock speed $s$ is given by the Rankine-Hugoniot jump condition:
$$
s = (1+0)/2\, .
$$
As long as the rarefaction and the shock don't interact, the solution is
therefore
$$
u(x,t) =
\left\lbrace
\begin{aligned}
& 0 &&\text{if }\; x\leq 0 \, , \\
& x/t &&\text{if }\; 0\leq x\leq t \, , \\
& 1 &&\text{if }\; t \leq x < 1+ t/2 \, ,\\
& 0 &&\text{if }\; 1+t/2 < x \, ,
\end{aligned}
\right.
$$
valid for times $t<t^*$ such that $t^* = 1 + t^*/2 = 2$. At the time $t^*$, both waves interact. The new shock speed is determined from the Rankine-Hugoniot condition
$$
x'(t) = (x(t)/t+0)/2 \, ,
$$
with initial shock speed $x'(t^*) = s$.
Hence, the solution for $t\geq t^*$ is
$$
u(x,t) =
\left\lbrace
\begin{aligned}
& 0 &&\text{if }\; x\leq 0 \, , \\
& x/t &&\text{if }\; 0\leq x< \sqrt{2t} \, , \\
& 0 &&\text{if }\; \sqrt{2t} < x \, .
\end{aligned}\right.
$$
I will be using method of characteristics (which is described in Wikipedia article for Burger's euqation in detail).
Writing down the equation:
$$\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}=0$$
This has the form of a full time derivative for some function:
$$\frac{du}{dt}=\frac{\partial u}{\partial t}+\frac{\partial u}{\partial x} \frac{dx}{dt}$$
Which gives us the following system of ODEs:
$$\frac{du}{dt}=0 \\ \frac{dx}{dt}=u$$
The solutions have the form:
$$u=u_0 \\ x=x_0+u_0 t$$
This seems surprising, but actually this means that for any $x$:
$$u \left(x+u(x,0)t,t \right)=u(x,0) \tag{1}$$
Now we want to get an explicit solution using our initial conditions.
- First, consider the simple case $|x|>1$, which means $u(x,0)=0$:
$$u(x,t)=u(x,0)=0 \tag{2}$$
- Now, the case $|x| \leq 1$, which means $u(x,0)=1-x^2$:
Let's make a substitution:
$$x+(1-x^2)t=y$$
We need to find $x(y,t)$ now to substitute on the right hand side of $(1)$:
$$t x^2-x+y-t=0$$
$$x=\frac{1}{2t} (1 \pm \sqrt{1+4t(t-y)})$$
Which makes our solution in this range to be:
$$u(y,t)=1-\frac{1}{4t^2} (1 \pm \sqrt{1+4t(t-y)})^2$$
Or, simply renaming the variable again, we have:
$$u(x,t)=1-\frac{1}{4t^2} (1 \pm \sqrt{1+4t(t-x)})^2 \tag{3}$$
You can directly check (by taking the derivatives) that the original equation is satisfied by this function.
If we want the limit at $t \to 0$ to exist, we need to choose the "$-$" sign in (3).
One thing we need to account for is the range $|x| \leq 1$ which separates the first solution from the second one. Not sure if we just can set the same condition on $y$ or not.
Let's consider the condition on $x$:
$$\left| \frac{1}{2t} (1 - \sqrt{1+4t(t-y)}) \right| \leq 1$$
Assume $t>0$:
$$\left| 1 - \sqrt{1+4t(t-y)} \right| \leq 2t$$
The solution is quite interesting:
$$-1 \leq y \leq 1, \qquad t \leq \frac12$$
$$-1 \leq y \leq \frac{4t^2+1}{4t}, \qquad t > \frac12$$
The latter case contradicts the initial condition on $x$ which we used to get our first, zero solution.
When plotting the solution in Mathematica for different times we see a 'crashing wave', which initially, doesn't go beyond $x=1$.
However, for larger times, it does go beyond the initial boundary:
Best Answer
In facts, it is impossible for a classical solution to solve the initial- and boundary-value problem. A plot of the characteristic curves in the $x$-$t$ plane deduced from the initial data is given below*:
The possibility of admissible discontinuities near the boundaries (weak solutions) should be examined. A look at the characteristics in the $x$-$t$ plane shows that such solutions are not admissible in the sense of Lax** (characteristics do not intersect appropriately). For example, at $x\simeq 1$, we have $u_R = 1$ and $u_L = 1/(1+t)<1$, so that $u_L < u_R$. No shock wave is admissible. Alternatively, we could have investigated the boundary $x\simeq -1$, where $u_L = -1$ and $u_R = -1/(1+t) > -1$. Here too, no shock wave is admissible, since $u_L < u_R$.
*The lines drawn outside $]-1,1[$ are the characteristics starting at the boundaries $x=\pm 1$, which have been represented outside the interior domain to keep the figure readable.
**The Lax entropy condition reads $u_L>s>u_R$ where $u_L$ is the value on the left of the discontinuity, $u_R$ is the value on the right of the discontinuity, and $s$ is the speed of shock given by Rankine-Hugoniot.