If $V = \{(x,y,z) \text{ such that } x^2 + y^2 + z^2 < a^2\text{ and }z>0\}$, use the spherical coordinate transformation to express $\int_V{z}$ as an integral over an appropriate set in $(\rho, \phi, \theta)$ space. Justify you answer.
Attempt at the solution : using $g(\rho, \phi, \theta) = (\rho \sin{\theta}\cos{\phi}, \rho \sin{\theta}\sin{\phi}, \rho \cos{\theta})$ and the fact that $\det Dg = \rho^2 \sin{\theta}$ gives us our limits of integration as follows: $ 0 < \rho < a$, $0 < \theta < \pi $, $0 < \phi < 2\pi $. I'm confused about the justify part, I think the diffeomrphism is defined over the set $(0, a) \times (0, \pi) \times ( 0, 2\pi)$, which implies that the positive $x$-axis is not included, so we will have to define a new set $V' = \{ x^2 + y^2 + z^2 , a^2, \text{ for }z> 0, x<0 \text{ if } y = 0\}$ and this will have the same answer since the non-negative $x$-axis has measure zero. I'm not sure if my intuition is right, if someone could provide me feedback on my answer that would be great .
Your limits of integration are wrong. Because $z > 0$, the limits on $\theta$ are $0 < \theta < \pi/2$. The solution is $$\int_V z\,dV = \int_0^{\pi/2}\int_0^{2\pi}\int_0^a \rho^3\cos \theta\sin\theta\,d\rho\,d\phi\,d\theta$$
The coordinate transformation is a local diffeomorphism except along the $z$-axis (not $x$). Along the $z$-axis, it becomes singular. But indeed since the axis has measure $0$, this has no effect on the integral.