Is the nuclear mass density constant for different nuclei and shape of the nucleus I was reading the Wikipedia page on nuclear density when I came upon a problem. (I haven't yet been introduced to nuclear physics.)
What form does the nucleus have? Is it spherical? How is it possible for the nucleus to be spherical? Looking at the nucleus in the Wikipedia image below, I can see that it is not exactly spherical and that there are empty spaces between the nucleons.

Now if we assume nucleus to be spherical, the $\text{Volume} \ V=\frac{4}{3}πr^3=\frac{4}{3}π(r_0​A^ {1/3})^3 =\frac{4}{3}πr_0^3​A$.
Now the $\text{Density of nucleus} \ \rho = \frac{\text{Mass of nucleus}}{\text{Volume of nucleus}}= \frac {A}{\frac {4}{3}πr_0^3​A}={\frac {3}{4\pi (1.25\ \mathrm {fm} )^{3}}}=0.122\ (\mathrm {fm} )^{-3}$. Therefore, the density for any typical nucleus, in terms of mass number, is thus constant, not dependent on $A$ or $r$, averaging about $2.3×10^{17} kg/m^3$.  However, this again contrasts with $r=A^{1/3}r_{0}$.
 A: $r_0$ will be the radius of one of the nucleons (proton or neutron).  This is consistent with your formula for the total volume:  $\frac{4}{3}\pi r_0^3 A$ which is just $A$ times the volume of one nucleon.
As for why the nucleus is a sphere, well that itself is an approximation.  Considering we're already approximating various things, such as the fact that the protons and neutrons themselves behave as hard spheres of the same size, I don't think it's a bad approximation to make -- why waste effort on a more "accurate" volume for this model, when there are already approximations in place?  And in any case, the sphere approximation is probably alright particularly for large $A$.
Finally, be careful with your definition of "density" and "mass density".  In this simple model, the nucleon density is indeed constant at $0.122\text{ fm}^{-3}$, but the mass density will be $0.122\text{ fm}^{-3}m_\text{N}$, where $m_\text{N}$ is the mass of your nucleus, which again we can approximate to be $Am_\text{n}$, where $m_\text{n}$ is the mass of a single nucleon.  There are more advanced models that change the mass of the nucleus here, such as the semi empirical mass formula that accounts for binding energy, which will depend on $A$.
Part of physics is deciding which approximations are appropriate to use when.  A simple sphere model like this is appropriate in some cases, but maybe not in others.
A: Beware of the cartoon illustrating your question: the nucleus is strongly quantum-mechanical, and the proton and neutron wavefunctions fill the entire nuclear volume. There are not “gaps between” the nucleons; a particular nucleon can’t properly be “localized” to one part of the nucleus versus another.
The overall shape of a nucleus is mostly spherical, but nuclei which are very large or have a lot of angular momentum may deviate from the sphere.  A nucleus with nonzero “quadrupole moment” may be “prolate” (elongated like a cigar or an American football) or “oblate” (flattened like a coin). The size of the quadrupole moment tells you about how non-spherical the nucleus.  I vaguely remember that the uranium-235 nucleus is, in its ground state, roughly cigar-shaped (prolate) with its length about twice its diameter; however I can’t instantly find a source for that.
A nucleus with a nonzero “octupole moment” can be described as “pear-shaped,” as illustrated below (source).

The nuclear density is approximately constant for most nuclei; a search term for a counterexample is halo nucleus (see also), where you can interpret the density profile of the nucleus as an ordinary-density core with one or two neutrons “orbiting” at a larger distance. Reconciling this cartoon description of a halo nucleus with my warnings about non-localizability takes some careful phrasing.
A: The picture on wikipedia is a simplification. It gives a correct idea about how nuclei sizes compare to each other and to a single proton. But it incorrectly suggests that protons and neutrons are packed into a nucleus like steel balls with some "gaps" in between.
What we know experimentally about nuclei is a charge density distribution reconstructed from electron-nucleus scattering. This doesn't include neutrons [Introductory Nuclear Physics book by K. Krane]

In theoretical calculations one can look at density of both protons and neutrons together [Vauterin, Brink, 10.1103/PhysRevC.5.626]

So, nuclei shapes are often close to spheres of constant density with a neutron skin, where density quickly drops. On top of the spherical shape there are various deformations that make certain nuclei more prolate, oblate, or pear-shaped. More exotic shapes are also possible.
