How to calculate the total charge of a sphere which has a none uniform charge distribution?
Your last equation is the right approach.

Assuming that \$\rho_r\$ is only a function of \$r\$ and not a function of \$x,y,z\$, your first thought about the thin shell is about right, except misapplied due to ignoring \$z\$. Instead, you just take the shortcut that you know the surface area at \$r\$ is \$4\pi\,r^2\$ and that it's thickness is obviously \$\text{d}r\$ (you are only certain that \$\rho_r\$ is exactly true for an infinitesimally thin shell, which of course is \$\text{d}r\$ thick.) So the volume of that thin shell is \$4\pi\,r^2\:\text{d}r\$.

Given that \$\rho_r\$ is in the units of \$\frac{\text{charge}}{\text{volume}}\$, multiplying it by the volume of the thin shell provides the charge in that thin shell. So it is correct to multiply the volume of the thin shell by your \$\rho_r\$ factor to get charge in that thin shell.

Integrating the sum of the charge in these thin shells results in the total charge of the sphere.

I might have just as well have written your last equation as \$\int 4\pi\,r^2\:\text{d}r\:\rho_r\$ or \$\int \rho_r\:4\pi\,r^2\:\text{d}r\$. It's all the same thing. But yes, I think you used the right equation at the end.