How do you know when there is a shock 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?
 A: 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.
A: I will give you an intuitive answer. what you have here is a 1 dimensional transport equation, $\phi(x,t)$ is some quantity being transported, at what velocity ? it is also at $\phi(x,t)$ !  (if you can't see why $\phi(x,t)$ is the velocity, open any intro PDE book)
so the larger $\phi(x,t)$, the faster the speed at (x,t). and if $\phi(x,t)$ is positive, the transportation is going right, if it's negative, it is going left. 
now make a plot of $\phi(x,0)$ vs x. at t=0, x=1: you have a step down looking function. on the left, the wave is going right with speed 1, while on the right, the wave is also going right with speed=0. what will happen t=0+ ? the left part being faster, overtakes the right part. you will have a multivalue $\phi(x,0)$ , and $u_x$ is infinity (also characteristic lines crosses). unshockingly, you have yourself a shock! your step will turn into a z shape around x=1. (physically this needs to be resolved by physics such as conservation laws, causality,...)
