Behaviour of density function when flattening the hemisphere Suppose I keep my hollow sphere centred at the origin and I define a uniform scalar value (say mass density) at each point of it, call it $\phi$. If I were to smoothly flatten the hemisphere into the $z=0$ plane, I would get a disc. Now, since the mass must remain constant under compression, the new flattened disc has some density function $\rho$ such that:
$$ \int_{disc} \rho dA = \int_{sphere} \phi dA$$
That is masses are conserved. Given the functional form of $\phi$ can determine what $\rho$ should be? If not, what about the special case where $\phi$ is uniform? How does the result generalize?

Context: I was reading this truly beautiful question on physics stack exchange and after some thought on what went wrong in OP's calculation , I think the question in OP's post will be solved if the answer to the above questions I've asked is answered.
 A: The most succinct way of stating the general case involves the notion of pull-back of differential forms; the final result will depend on how exactly you "flatten" the hemisphere into a disc.
To gain some intuition, let's avoid the hemisphere and disc example for now, because the hemisphere is curved, so that complicates matters. I think it is best (as always in analysis/geometry) to start with the flat and linear case and proceed from there (after all, differential calculus is all about local linear approximations).
For any $r>0$, let $M_r\subset \Bbb{R}^2$ be the open disc centered at the origin with radius $r$. Now, fix a value of $R>0$, and consider the following map $f:M_1\to M_R$ defined by $f(x,y):= (Rx,Ry)$.  In words, we're taking the (flat) unit disc and scaling it (a linear transformation) to a disc of radius $R$. Physically you can think of this as an elastic circular balloon-like object and you're stretching/squishing it uniformly in all directions. Suppose now that on the surface $M_R$ is a constant surface-mass density, of value $\sigma_0$. Since $f$ is a linear transformation which simply scales everything uniformly in all directions, one can expect that the induced surface-mass density $\rho$ on $M_1$ ought to be a constant $\rho_0$. So, $\rho_0$ and $\sigma_0$ are constants, but are they the same constant? Certainly not. By "conservation of mass" they must satisfy
\begin{align}
\int_{M_1}\rho_0\,dA_1 &=\int_{M_R}\sigma_0\,dA_R
\end{align}
In this case everything is simple and it reduces to
\begin{align}
\rho_0\cdot \pi(1)^2&= \sigma_0\cdot \pi(R)^2\tag{$*$}
\end{align}
and hence $\rho_0=\sigma_0\cdot R^2$. To gain a better understanding of what this term means, note that $R^2$ is the ratio of the area of $M_R$ to the area of $M_1$. In this special case, you can also recognize this as $|\det Df|$ (if you've done some multivariable integration you know that the determinant of the derivative tells you locally the volume scaling factor). So, the induced mass density is the same as $\sigma_0$, multiplied by an area scale-factor, which physically we interpret as "conservation of mass".
Ok, with this rough motivation, let us try to generalize completely. Let $M,N$ be smooth manifolds and $f:M\to N$ a diffeomorphism. A manifold is just a higher dimensional analogue of curves and surface (so the open unit discs I've considered above, and hemispheres and spheres are all examples of 2-dimensional smooth manifolds). $f$ being a diffeomorphism means it provides a smooth bijective correspondence between $M$ and $N$, i.e a means of "deforming" $M$ to $N$. Let $dV_M$ and $dV_N$ denote the volume elements of $M$ and $N$ respectively. Now, suppose that we have a continuous function $\sigma:N\to \Bbb{R}$; physically you can regard this as me providing a continuous mass distribution on the "higher-dimensional surface $N$". Our objective is to now define a mass distribution $\rho$ on $M$, which somehow "corresponds to $\sigma$ via the deformation $f$".
Now, consider a point $a\in M$; we have to prescribe some value for $\rho(a)$, i.e we have to decide how much mass density is present at this point. So, what we do is look at the corresponding point $f(a)\in N$. There we know that the mass density is $\sigma(f(a))$. We would of course like the mass situated at the point $f(a)\in N$ to get "transferred" to the point $a\in M$. To motivate the following formula, note that because $\sigma$ was assumed continuous, we can roughly assume that if we are close enough to the point $f(a)$, then $\sigma$ remains a constant value of $\sigma(f(a))$. So, we are back to our special case above. We know (by ($*$)) that $\rho(a)$ has to be $\sigma(f(a))$ times a certain scale factor of how the volumes transform under the mapping $f$; this is how we ensure conservation of mass "on an infinitesimal level". So our definition is now that for any point $a\in M$,
\begin{align}
\rho(a)&:=\sigma(f(a))\cdot (\text{limit of ratio of volumes under the mapping $f$, about the points $a$ and $f(a)$})
\end{align}
Of course, this is not a rigorous definition at all, because I haven't concretely defined what I mean by the ratio of the volumes, but hopefully you get the idea. The above "equation" is about as good as I can word things without getting too formal.

Now, if you want to be super precise, there are two ways I can formalize this. The first is using measure theory (Radon-Nikodym derivatives), and the second is using pull-back of differential forms.

Formula Using Measure Theory.
Let $(M_1,g_1)$ and $(M_2,g_2)$ be two (pseudo-)Riemannian manifolds, and let $f:M_1\to M_2$ be a diffeomorphism. Let $dV_{g_1}$ and $dV_{g_2}$ denote the induced measures on $M_1$ and $M_2$ by the metric tensors $g_1,g_2$ respectively. If we consider a (for simplicity continuous) function $\sigma:N\to [0,\infty)$, physically regarded as "mass density on $M_2$", then the corresponding induced mass-density $\rho$ on $M$ is defined as
\begin{align}
\rho&:= (\sigma\circ f)\cdot \frac{dV_{f^*(g_2)}}{dV_{g_1}},
\end{align}
where on the RHS we have the Radon-Nikodym derivative.

This is the precise meaning of the ratio of volumes, and in the special case where $M_1$ and $M_2$ are open subsets of $\Bbb{R}^n$ (in the case of $(*)$ above we dealt with $\Bbb{R}^2$), the ratio on the right simply reduces to $|\det Df|$, which you may be very familiar with from multi-variable integration.
On the other hand, using differential forms is much more natural in this setting, and they make calculations very routine. The idea is that rather than thinking of surface density as a real valued function on the surface, you think of it as a $2$-form instead (or more generally with  top-degree differential form on the manifold). In this language, the formula becomes very simple:

Formula Using Differential Forms
Let $M_1, M_2$ be smooth manifolds, say of dimension $k$, and let $f:M_1\to M_2$ be a diffeomorphism. Let $\mu$ be a $k$-form on $M_2$ (physically regarded as a mass density on $M_2$). Then, the corresponding mass density induced on $M_1$ via the mapping $f$ is the pull-back $k$-form $\nu:= f^*(\mu)$.

In this language, the change-of-volume factor is already encoded into the definition of the pull-back.

Calculation for the Hemisphere and Disc.
Consider $M_1\subset\Bbb{R}^2$ to be the open unit disc centered at the origin, and $M_2\subset\Bbb{R}^3$ to be the unit upper hemisphere, centered at the origin. Define $f:M_1\to M_2$ by $f(\xi,\eta):= (\xi,\eta,\sqrt{1-\xi^2-\eta^2})$. The mapping $f$ should be thought of as "vertically lifting the unit disc to the hemisphere" while the inverse map $f^{-1}$ should be thought of as "vertically flattening the hemisphere to the unit disc". You can easily verify that everything is nice and smooth.
Suppose $\sigma:M_2\to \Bbb{R}$ is a given density function, and $\mu= \sigma\, dA$ is the corresponding $2$-form. If we let $(x,y,z)$ denote the standard coordinates in $\Bbb{R}^3$, then you can verify that the area element of the (hemi)sphere is
\begin{align}
dA&=x\,dy\wedge dz+y\,dz\wedge dx+z\,dx\wedge dy
\end{align}
So, the pull-back form is
\begin{align}
f^*(\sigma\,dA)&= (\sigma \circ f)\cdot f^*(x\,dy\wedge dz+y\,dz\wedge dx+z\,dx\wedge dy)\\
&=(\sigma\circ f)\cdot \left[\xi\,d\eta\wedge\left(\frac{-\xi\,d\xi-\eta\,d\eta}{\sqrt{1-\xi^2-\eta^2}}\right) +\eta\left(\frac{-\xi\,d\xi-\eta\,d\eta}{\sqrt{1-\xi^2-\eta^2}}\right)\wedge d\xi +\sqrt{1-\xi^2-\eta^2}\,d\xi\wedge d\eta\right]\\
&=\frac{\sigma\circ f}{\sqrt{1-\xi^2-\eta^2}}\,d\xi\wedge d\eta
\end{align}
In other words, if you let $\rho:M_1\to \Bbb{R}$ denote the corresponding density function then
\begin{align}
\rho(\xi,\eta)&=\frac{\sigma(f(\xi,\eta))}{\sqrt{1-\xi^2-\eta^2}}=\frac{\sigma\left(\xi,\eta,\sqrt{1-\xi^2-\eta^2}\right)}{\sqrt{1-\xi^2-\eta^2}}.
\end{align}
In particular, observe that if you want a constant value for $\rho$ then you need something of the form $\sigma(x,y,z)=cz$, so the density is symmetric about the vertical axis, and varies linearly as we increase in height. Then, the above formula shows that $\rho(\xi,\eta)=c$ is a constant.
The versatility of differential forms can be seen by virtue of the fact that we can arrive at the same answer very easily using spherical coordinates on the hemisphere and polar coordinates in the plane (and a little overload of notation).

*

*In the unit disc, introduce polar coordinates $r,\varphi$, so that the area element is $r\,dr\wedge d\varphi$, where $0<r<1$ and $0<\varphi<2\pi$.


*In the hemisphere, introduce spherical coordinates $\theta,\phi$ where $0<\theta<\frac{\pi}{2}$ and $0<\varphi<2\pi$. The relation to cartesian coordinates is that $x=\sin\theta\cos\varphi, y=\sin\theta\sin\varphi$ and $z=\cos\theta$.
Then,
\begin{align}
f^*(\sigma\,dA)&=f^*(\sigma\, \sin\theta\,d\theta\wedge d\varphi)\\
&=f^*(\sigma \cdot (-d \,\cos\theta)\wedge d\varphi)\\
&=f^*(\sigma\cdot (-dz)\wedge d\varphi)\\
&=\sigma\circ f\cdot (-d\sqrt{1-r^2})\wedge d\varphi\\
&=\frac{\sigma\circ f}{\sqrt{1-r^2}}\cdot(r\, dr\wedge d\varphi).
\end{align}
A: It depends on how we are deforming a unit hemisphere to a unit disk but here is a simplistic view.
Unit disk surface is $x^2+y^2 \lt 1, z = 0$
For hemisphere surface, $z^2 = 1 - x^2 - y^2$
$\dfrac{\partial z}{\partial x}  = - \dfrac{x}{z}, \dfrac{\partial z}{\partial y} = - \dfrac{y}{z}$
If surface area element of hemisphere is $dS$ and that of the unit disk is $dA$,
$dS = \sqrt{1 + \left(\dfrac{\partial z}{\partial x}\right)^2 + \left(\dfrac{\partial z}{\partial y}\right)^2} \ dA = \dfrac{1}{z} \ dA$
If the mass density of hemisphere is $\rho_s (x, y)$,  we can then represent mass density of the disk as,
$\rho_d(x, y) = \dfrac{\rho_s (x, y)}{\sqrt{1-x^2-y^2}}$ where $x^2+y^2 \lt 1$ is the unit disk.
The same can be expressed in polar coordinates.
