Shock formation in an inviscid Burgers' like equation Consider the equation 
$$\frac{\partial u}{\partial t} +\frac{\partial}{\partial x}(u^2+uf(x,t)) =0$$
where $f(x,t)$ is a suitably well behaved function. Given the initial condition $u(x,t=0)$, for which family of functions $f(x,t)$ will shocks form? 
Note, for $f=0$, we return to the inviscid Burgers' equation, which admits shock solutions. 
 A: Take one spatial derivative of the equation. You get something like
$$
u_{xt}+u_x^2+uu_{xx}+(u_xf+uf_x)_x=0
$$
Write $v=u_x$. Then,
$$
v_{t}+v^2+(u+f)u_{xx}+2vf_x+uf_{xx}=0.
$$
We know that 
$$
\max_x |u(x,t)|\leq \max_x|u_0(x)|,
$$
where $u_0$ is the initial data. Then, we have that if we evaluate the eqution for $v$ at the point where $v$ reaches its minimum, we have
$$
\frac{d}{dt}y+y^2+2yf_x+uf_{xx}=0,
$$
where $y(t)=\min_x v(x,t)=v(X(t),t)$.
If a shock is formed is because $\liminf_{t\rightarrow T} y(t)=-\infty$, for certain $T$.
So, now you can see for which functions $f$ (and initial datas $y(0)$) the equation for $y$ does NOT blow up. Those are the functions $f$ that prevent the shocks.
Hopefully this helps.
%%%% Expanded answer (see comments below) %%%%
Let me try to give you a family of functions such that there is NO shock. The same idea may be used to show some families of f leading to shocks. 
The idea is to get some assumptions on $u_0$ and $f$ such that we prove that $y'>0$. Then, as $y(0)<0$, we obtain a global bound for the minimum of the derivative (so, no shocks are formed). 
Assume 
1) 
$$
u_0< 0
$$
2)
$$
f\leq0
$$ 
(so, $u(t)$ remains non-positive for all times where the solution exists). To see that notice that the evolution of 
$$
U(t)=\max_x u(x,t)=u(\tilde{x}(t),t)
$$
reads
$$
U'(t)=-f_x(\tilde{x}(t),t)U(t).
$$
3)
Assume also that $\infty>c\geq f_x(x)\geq C>0$ and $f_{xx}(x)\geq 0$ for all $x$. 
Then the previous ODE for $y$ implies
$$
y'\geq -y(y+2f_x(X(t)).
$$
We need 
$$
y(t)+2f_x(X(t))>y(t)+2C>0.
$$
Thus, if $u_0$ is such that $y(0)+2C>0$ (or $0>\min_s (u_0)_x(s)>-2C$, which is a 'smallness' requirement), we have $y'(h)>0$ (for $h$ close to zero), which means $y(t)>y(0)>-2C$ (so, our assumptions on the initial data propagates in time).
