Consider the functions
$$v_1(r,\theta,\phi)=\frac{1}{r^2}\hat{r}\tag{1}$$
$$v_2(r,\theta,\phi)=\frac{1}{r}\hat{r}\tag{2}$$
Let $S$ be a spherical surface of radius $R$ centered at the origin.
Then
$$\iint\limits_{\text{sphere}} v_1\cdot\hat{n}dS=\int_0^{\pi}\int_0^{2\pi} \frac{1}{R^2}\hat{r}\cdot R^2\sin{\phi}\hat{r}d\theta d\phi=4\pi\tag{3}$$
and
$$\iint\limits_{\text{sphere}} v_2\cdot\hat{n}dS=\int_0^{\pi}\int_0^{2\pi} \frac{1}{R}\hat{r}\cdot R^2\sin{\phi}\hat{r}d\theta d\phi=4\pi R\tag{4}$$
and the divergences are
$$\nabla\cdot v_1=\frac{1}{r^2}\frac{\partial}{\partial r} \left (r^2\frac{1}{r^2} \right )=0\tag{5}$$
$$\nabla\cdot v_2=\frac{1}{r^2}\frac{\partial}{\partial r} \left (r^2\frac{1}{r} \right )=\frac{1}{r^2}\tag{6}$$
for $r\neq 0 $ in both cases. Neither $v_1$ nor $v_2$ is defined for $r=0$ and neither are their divergences.
My question is: can we apply the divergence theorem to each of these vector fields?
It would seem to me that we can't because one of the assumptions of the divergence theorem is that the vector field be continuously differentiable on the solid in 3-space over which the triple integral in the theorem is being taken.
Neither of our vector fields, however, is even defined at the origin, which is a point inside the spherical volume we can use for the theorem.
If we try to compute the triple integrals
$$\iiint\limits_{\text{sphere}} \nabla\cdot v_1 dV =0\tag{7}$$
$$\iiint\limits_{\text{sphere}} \nabla\cdot v_2 dV =4\pi R\tag{8}$$
Then the divergence theorem seemingly checks out in the second case. But does it really or is it just some coincidence. That is, is it correct to do the calculations (7) and (8)?