I'm not understanding when a shock exists. I know it has something to do with characteristics intersecting but other than that I'm not sure.
For example, for the PDE, $$\frac{\partial\phi}{\partial t}+\phi\frac{\partial\phi}{\partial x}=0$$
subject to the initial condition $$\phi(x,0)=f(x)=\left\{ \begin{array}{l l} 0,\quad x<0 \\ 1, \quad 0\leq x<1 \\ 0, \quad x\geq 1 \end{array} \right. $$
I think there is a shock at $x=0$ or $x=1$ but I don't know why. Can someone help me understand why there's a shock?
At $x=0$ there is a rarefaction fan, whereas at $x=1$ there is a shock. Indeed, the flux function $F(u) = u^2/2$ is convex, hence (by the standard theory of entropy solutions) you have a shock in correspondence of downward jumps, and a rarefaction fan in the opposite case.