Q:

Where does the formula for the moment of inertia $I = \int r^2 dm$ come from?

I've just learned about moments of inertia in my physics I class, $I=\int{r^2dm}$. The math involving moments of inertia in relation to torque and angular momentum is clear to me. I'm looking for some intuition towards where the definition/idea of moments of inertia comes from? Where do we obtain that the moment of inertia of a point mass $I=mr^2$?
I'm interested in the logical development of these ideas. 

A:

Let's consider linear acceleration, governed by $F = ma$. If you have a system with many particles, and want to accelerate a system as a whole, the inertia depends on the total mass
$$m_{\text{tot}} = \sum m_i = \int dm$$
where I just converted the sum over masses into an integral.
Now consider a single particle with mass $m$ rotating at radius $r$. Using $\tau = F r$ and $a = r\alpha$, the relationship between torque and angular acceleration is
$$F = m a \quad \to \quad \frac{\tau}{r} = mr \alpha \quad \to \quad \tau = (mr^2) \alpha.$$
We define the moment of inertia to be $I = \tau/\alpha$, analogous to $m = F/a$. Then we see the moment of inertia of a particle is $mr^2$.
Now suppose you want to make a system rotate as a whole. Since each individual particle contributes a moment of inertia of $m_i r_i^2$, the total moment of inertia is just the sum,
$$I_{\text{tot}} = \sum m_i r_i^2 = \int r^2 dm.$$
That's where the formula comes from.

