Unit content
Moment of inertia of continuous mass distributions
For point masses, the moment of inertia about a chosen axis is
$$I=\sum_i m_i r_{\perp i}^2,$$
where $r_{\perp i}$ is each mass's perpendicular distance from the axis. For a continuous body, the same idea becomes an integral over small mass elements:
$$\boxed{I=\int r_\perp^2,dm}.$$
The main task is to express the mass element $dm$ in coordinates that match the geometry.
For a one-dimensional distribution with linear mass density $\lambda$,
$$dm=\lambda,ds.$$
For a thin surface with surface mass density $\sigma$,
$$dm=\sigma,dA.$$
For a three-dimensional body with volume mass density $\rho_m$,
$$dm=\rho_m,dV.$$
For a uniform body these densities are constant and can be found from total mass divided by total length, area, or volume.
Uniform rod about its center
Consider a thin uniform rod of length $L$ and mass $M$, rotating about an axis through its center and perpendicular to the rod. Put the rod along the $x$-axis. Its linear density is
$$\lambda=\frac{M}{L},$$
so
$$dm=\lambda,dx.$$
A mass element at coordinate $x$ is a perpendicular distance $|x|$ from the axis. Therefore
$$I=\int_{-L/2}^{L/2}x^2\lambda,dx =\frac{M}{L}\int_{-L/2}^{L/2}x^2,dx.$$
Evaluating the integral,
$$I=\frac{M}{L}\left[\frac{x^3}{3}\right]_{-L/2}^{L/2} =\boxed{\frac{1}{12}ML^2}.$$
The result scales as $ML^2$, as dimensional reasoning suggests, but the numerical factor comes from the mass distribution.
Uniform disk about its symmetry axis
For a thin uniform disk of radius $R$ and mass $M$, use concentric rings of radius $r$ and thickness $dr$. The surface density is
$$\sigma=\frac{M}{\pi R^2}.$$
A ring has area
$$dA=2\pi r,dr,$$
so its mass is
$$dm=\sigma 2\pi r,dr.$$
Every point on that ring is distance $r$ from the symmetry axis, hence
$$I=\int_0^R r^2,dm =2\pi\sigma\int_0^R r^3,dr.$$
Thus
$$I=2\pi\frac{M}{\pi R^2}\frac{R^4}{4} =\boxed{\frac12MR^2}.$$
Choosing the mass element
Different decompositions can describe the same body, but a good choice makes $r_\perp$ simple and groups together material at the same distance from the axis. Rod elements work naturally for slender bodies; concentric rings are natural for disks and cylinders; shells or slices can be useful for other geometries.
The integral is not a new definition unrelated to the point-mass formula. It is the continuous limit of the same weighted sum: mass farther from the axis contributes more strongly because its distance is squared.