Check if $u_y+u^2 u_x = 0$ with rectangular initial data has a shock 
I have the p.d.e. $$u_y+u^2 u_x =0$$ $x \in \mathbb{R}$, $t>0$
with $$u(x,0)=h(x)= \begin{cases} 0 & x<0 \\ 1 & 0<x<1 \\ 0 & x>1 \end{cases}$$
Check if a shock forms and solve the p.d.e.

My attempt, the characteristic curves are $(s,0,h(s))$, so I have $$\frac{dy}{dt}=1 \implies y=t$$
$$\frac{du}{dt}=0 \implies u=h(s)$$
$$\frac{dx}{dt}=u^2 \implies x=h^2(s)t+s$$
So the solution is $$u=h(x-u^2y)$$ $$u= \begin{cases} 0 & x<0 \\ 1 & t <x <t+1 \\ 0 & x>1 \end{cases}$$
Now this is where I am stuck, how do I check if a shock forms?
And how do I proceed to solve the problem?
 A: The present problem is very similar to the case of (...) Burgers' equation with rectangular data. However, the present PDE rewrites in conservation form as $u_y + (\frac13 u^3)_x = 0$, hence the flux $\frac13 u^3$ is nonconvex. Following this post, the solution for small times reads
$$
u(x,y) = \left\lbrace\begin{aligned}
&0 &&x\leq 0\\
&\sqrt{x/y} &&0\leq x\leq  y\\
&1 &&y\leq x< 1+y/3\\
&0 && 1+y/3< x
\end{aligned} \right.
$$
which is valid up to $y = 3/2$. One notes that the initial discontinuity located at $(x,y)=(0,0)$ leads to the formation of a rarefaction wave, while the initial discontinuity located at $(x,y)=(1,0)$ leads to a shock wave (these facts follow from the entropy condition -- or from the intersection of characteristic curves, if you prefer). Then, the interaction of the rarefaction and shock waves can be computed in a similar way to the case of the Burgers' equation.
A: To recognize the formation of singularities (shocks) in your equation you may look for the intersection of characteristics curves. It is known that any smooth solution of your problem must be constant along characteristic curves, and if there is such an intersection, singularities arise.
Now, from your characteristic system, it can be seen that
$$ \frac{dx}{dy} = u^2, $$
due to the constancy of $u$ along characteristics, this means that the projection of the charactericts curves are straight lines with slope given by $1/u^2(x,0)$. Try to draw them out and use your initial condition to see if those lines intersect at some point.
On the other hand, to find a solution for your problem, you should bear in mind something which is known in the literature as the "jump condition" or "Rankine-Hugoniot condition". You can find information about it (together with nice examples) in Joel Smoller book : "Shock waves and reaction diffusion equations" Chapter 15. This condition allows you to give discontinuous solutions for your problem whenever an specific relation between the speed of propagation of the discontinuity and the values of the solution at both sides of the discontinuity is satisfied.
Roughly speaking, you must ensure that if $s$ is the speed of propagation of the discontinuity, then
$$ s[u]=[u^2],$$
where $[u]= u_r - u_l$, $[u^2] = u_r^2 - u_l^2  $ and $u_r$, $u_l$ are the values of $u$ at the right and left of the discontinuity respectively.
