How do you know when you need to use distributions to represent charge densities? I tried to solve a problem using Gauss' law in the following way.
Let's assume we have a spherical shell of radius $R$ with a charge $Q$ being homogenously distributed on its surface. I am trying to figure out the $E$-field generated by this assembly using Gauss' law.
It seems clear to me that for $r < R$, the $E$-field must equal 0. Now for $r > R$, one obtains
$$ E(r) \cdot 4\pi r^2 =  \oint_{\partial U_r} E \; dA = \int_{U_r} \nabla \cdot E\; dV = \int_{U_{r}} \frac{\rho}{\epsilon_0} \; dV $$ 
But in this case, $\rho = 0$ everywhere except on $\partial U_r$, so we get
$$\int_{U_{r}} \frac{\rho}{\epsilon_0} \; dV = \int_{\partial U_{r}} \frac{\rho}{\epsilon_0} \; dV = 0$$
as the volume of $\partial U(r)$ is equal to 0. This was my original, incorrect solution.
If I got the hint provided in the comments right, it seems that the charge density should have the following form
$$\rho(r) = \delta(R-r)\cdot \frac{Q}{4\pi R^2}$$
where $\delta$ is the Dirac delta distribution, and that this will allow me to correctly calculate the $E$-field, yielding $$E(r) = \frac{Q}{4\epsilon_0 \pi r^2}, \quad r > R$$
All of this leads me to the following question: How does one recognize in general that one should use distributions instead of ordinary functions?
 A: Using distributions is a trick that people use whenever dealing with systems that do not have the required smoothness and integrability conditions and is in general only a mathematical technique to nevertheless solve those problems.
Maxwell equations, to start with, require both sides to be differentiable (at least a few times) and integrable and when you make use of the Gauß law you are implicitly accepting all the hypotheses and requirements it comes with. Amongst these, certain integrability and boundary conditions here and there.
Having a charge distribution that is always zero except, suddenly, on a set of zero measure (the boundary) is in fact one of those conditions that do not satisfy the requirements; also, in nature, things never become suddenly zero, rather they do so smoothly. Here the mathematical trick is that the Dirac delta has the nice property to give back smooth functions after being integrated over and therefore hides the problem away. The correct way to deal with such exercises is to extend the domain of definition of the Maxwell equations on the dual set of functions (i. e. the distributions), thus allowing for less strict differentiability conditions in order to allow formal manipulations with Dirac deltas and so on. But unless you are attending classes in algebraic quantum field theory for mathematicians, physicists never do that and cope with the mathematical tricks as long as the solutions is correct.
