$\frac{0}{0}$ from Curvilinear Dirac Delta The definition of the Dirac Delta in an arbitrary curvilinear coordinate:
$$\delta(\vec{r})=\frac{\delta(x^1-x^1_0)\delta(x^2-x^2_0)\cdot \cdot\cdot \delta(x^N-x^N_0)}{h_1h_2\cdot\cdot\cdot h_N}$$
where $h_i=\sqrt{g_{ii}}$ are the scale factors.
For the spherical coordinates
$$\delta(\vec{r})=\frac{\delta(r-r_0)\delta(\theta-\theta_0)\delta(\phi-\phi_0)}{r^2sin(\theta)}$$
and if it is independent of $\theta, \phi$, the denominator becomes
$$\int_0^{2\pi}\int_0^{\pi}r^2sin(\theta)d\theta d\phi=4\pi r^2 \to \delta(\vec{r})=\frac{\delta(r-r_0)}{4\pi r^2}$$
Consider a spherical shell of radius $R$ with total charge $Q$, there are two ways to obtain the volume charge density $\rho(\vec{r})$.

Method $1$:
Use an ansatz.
The Direc Delta is independent of $\phi, \theta$ so assume $\rho(\vec{r})=K\delta(r-R)$, where $K$ is a constant to be determined.
$$\int_{\text{all space}}\rho(\vec{r})dV=\int_0^{2\pi}\int_{0}^{\pi}\int_{0}^{\infty}K\delta(r-R)(r^2sin(\theta))drd\theta d\phi=4\pi KR^2 =Q $$
$$K=\frac{Q}{4\pi R^2} \to \rho(\vec{r})=\frac{Q}{4\pi R^2}\delta(r-R) \tag{1}$$.

Method $2$: Use Dirac Delta in spherical coordianates:
$$\rho(\vec{r})=Q\delta(\vec{r})=Q\frac{\delta(r-R)}{4\pi r^2}=\frac{Q}{4\pi r^2}\delta(r-R) \tag{2}$$
Verifying
$$\int_{\text{all space}}\rho(\vec{r})dV=\frac{Q}{4\pi }\int_0^{2\pi}\int_0^{\pi}\int_0^{\infty}\frac{\delta(r-R)}{r^2}(r^2sin(\theta))drd\theta d\phi=Q$$.

My question:
$(1)$ and $(2)$ are obviously different. I understand that both give $\rho=0$ for $r\neq R$. But at the origin where $r=0$, $(1)$ still gives $0$ (denominator independent of $r$) but $(2)$ is undefined (of the form $\frac{0}{0}$), or would $(2)$ also give $0$? What's going on here?
 A: You should not try to think of the $\delta$ as a "usual" function when saying that (2) is undefined at $r \rightarrow 0$, because, in fact, $\delta$ is not a function. It is a distribution. You can view them as kinds of weights to integrate test functions, as in the following formula:
$$f(x) = \int\delta(y-x)f(y)dy$$
From this definition, two expressions involving distributions can be said to be equal if they give the same result when you use them to integrate any function over any open interval (disclaimer : I'm not a mathematician, this definition is only my gut feeling and should be taken with some precautions). Using this definition of equality, you will see that your (1) and (2) are equal
A: You have the same "problem" in both formulations.
Let's look at your Method 1. You have $$\rho(\vec r) =\frac{Q}{4\pi R^2}\delta(r-R).$$ You were happy that this was well-behaved at the origin. But what if I try to integrate your charge density to find the total charge? I will write
$$\int d^3\vec r\, \rho(\vec r)=
\frac{Q}{4\pi R^2}\cdot 4\pi\int_0^\infty dr\,r^2\delta(r-R).$$
The range of integration over $r$ goes up to $\infty$. But the delta function is zero there because $R$ is finite. Now what is $\infty^2\cdot 0$? It's the same either way you look at it.$^*$
The solution to your woes, as others have pointed out, is to stop thinking of delta as a function that is zero almost everywhere, and recall that it is a distribution, i.e., a thingy that acts on a function and simply tells you its value at a certain point. In your case, that certain point is $R$ at which everything is well-behaved. Although we often write this operation as an integration, that's not really essential, and in this case is leading to confusion.
Finally, here's an alternative way you could have formulated your Method 2. Recall the delta function identity
$$\delta(f(x)) = \sum_{f(x_i)=0} \frac{\delta(x-x_i)}{|f'(x_i)|}.$$
The sum is over solutions to the equation $f(x)=0$. Using this we can rewrite $$\rho(\vec r) =\frac{Q}{4\pi r^2}\delta(r-R)=\frac{3Q}{4\pi }\delta(r^3-R^3).$$ This form doesn't even have the superficial problem that you were concerned about.

$^*$ This paragraph is clearly meant to give a pedagogical example of why such concerns are not valid. I am obviously not saying it as evidence that there is a problem. Please continue to the next paragraph.
