Setting limits on a Triple Integral 
The original problem: 
  Find the Moment of Inertia $I$ of a solid sphere of uniform density $\rho$.

$$$$
I thought of doing it using Triple Integrals. 
Moment of Inertia for Continuous Distribution of particles is $\int r^2 dm$ with suitable limits ($r$ represents the radius while $dm$ is an elementary mass). $$dm=\rho dV$$
$$$$
Thus, the moment of Inertia can be represented as $$\int\int\int_V r^2\rho dV$$
From the Jacobian, $dV=r dr d\theta dz$ (converting into cylindrical coordinates).
$$$$
Hence, $$I=\int\int\int r^3 \rho drd\theta dz$$
$$$$
I can't set limits on $r$ and $z$.
I would be  grateful if somebody could help.
 A: Another word for a solid sphere is "ball".
The problem statement does not say what the radius of the ball is.
Since the moment of inertia will be a function of the radius of the ball,
let's use $R$ to denote that radius.

One way to find the limits of integration is via Cartesian coordinates.
The ball of radius $R$ centered at the origin 
consists of all points $(x,y,z)$ such that 
$$x^2 + y^2 + z^2 \leq R^2. \tag 1$$
Having set up the order of integration as you did,
$I=\iiint r^3 \rho\;dr\;d\theta \;dz$,
in general (for any region over which you want to integrate)
the limits of $z$ are independent of $r$ and $\theta$, the limits of
$\theta$ depend only on $z$, and the limits of $r$ may depend on
both $\theta$ and $z$.
Hence $z$ is limited only by Inequality $(1)$.
From that inequality it follows that $z^2 \leq R^2 - (x^2 + y^2)$.
Since $x^2 + y^2$ can be zero but cannot be less than zero,
this tells us that $z^2 \leq R^2$.
Moreover, $(0,0,R)$ and $(0,0,-R)$ both satisfy Inequality $(1)$,
so the limits of $z$ are $-R$ and $R$.
As you already observed, when $-R < z < R$ the ball has points at every
possible angle $\theta$, so we can integrate $\theta$ from $0$ to $2\pi$.
For $r$, we have $r^2 = x^2 + y^2$, so from Inequality $(1)$ we have
$r^2 + z^2 \leq R^2$ and $r^2 \leq R^2 - z^2$.
Any $x$ and $y$ that satisfy this inequality give a point in the ball,
regardless of $\theta$.
We also want $r \geq 0$. Therefore $0 \leq r \leq \sqrt{R^2 - z^2}$.
The limits of integration are
$$\int_{-R}^R \int_0^{2\pi} \int_0^{\sqrt{R^2 - z^2}} r^3\rho \;dr\;d\theta\;dz.$$

A second way to look at this is directly in cylindrical coordinates.
The surface of the ball
intersects the $z$-axis at $z=-R$ and $z=R$, and the ball intersects all
points of the $z$-axis between those limits.
But any point with $|z|>R$ is outside the ball, so we just have to integrate
$z$ from $-R$ to $R$.
Again, we integrate over $\theta$ from $0$ to $2\pi$ regardless of $z$,
by symmetry,
but taking the origin of coordinates as the center of the ball,
the distance from the center of the ball to the point at cylindrical coordinates $(r,\theta,z)$ is $\sqrt{r^2 + z^2}$.
This distance must not be greater than $R$, that is,
$\sqrt{r^2 + z^2} \leq R$, from which we get
$r^2 + z^2 \leq R^2$ and (as before) $0 \leq r \leq \sqrt{R^2 - z^2}$.

A third approach is to consider that this order of integration is an
application of the "disc" method of integration.
Viewing the ball as a stack of "discs", the disc on the "bottom" is at
$z = -R$ and the disk on "top" is at $z = R$, so $-R \leq z \leq R$.
The "discs" are in fact actually circular discs, so we can integrate
over $\theta$ from $0$ to $2\pi$.
The radius of the disc at $z$-coordinate $z$
is a leg of a right triangle whose other leg is a segment of length $|z|$
along the axis and whose hypotenuse is $R$, so the radius of the disc is
$\sqrt{R^2 - z^2}$, and we want to integrate $r$ over the
interval $0 \leq r \leq \sqrt{R^2 - z^2}$.

There are a number of closely-related questions that may also be of interest,
such as Using triple integral to find the volume of a sphere with cylindrical coordinates.
