SamRoss said:
... plugging in m=0 and v=c (including the v in γ) would give E=0/0.
You're so close to understanding!
Forget relativity for a moment. By the end of the 1800s, we had Newtonian mechanics on the one hand and Maxwell's electromagnetics on the other. Momentum was supposed to be a conserved quantity ##\vec p = m \vec v##, but Maxwell's theory predicted that light carried momentum despite being massless (because otherwise momentum couldn't be conserved). This prediction was verified experimentally just a few years before Einstein's annus mirabilis:
https://en.wikipedia.org/wiki/Radiation_pressure#Discovery
So even before special relativity was formulated, it was known that ##\vec p = m \vec v## couldn't be a
definition of momentum. Rather, momentum was fundamentally a conserved vector quantity, and for everything except light the formula ##\vec p = m \vec v## held. This was suspicious. Shouldn't there be a way to express momentum that applies to everything? (And wouldn't it be preferable if the formula didn't return a value of zero for light?)
Now, in special relativity we have these two equations:
##E = \gamma m c^2##
##\vec p = \gamma m \vec v##.
But as you note, if you plug in ##m = 0## and ##v = c##, you end up with ##E = 0/0## and ##\vec p = \vec 0 / 0##, which are undefined. What does that tell us? Nothing much. Just that these equations are inapplicable to massless things. Now, this is a big step up from the pre-relativistic situation, when the formula ##\vec p = m \vec v## would give
zero momentum for light, and all one could do was say "Well, that's not right, so I guess the formula just doesn't apply to light." With the undefined business, the
math is telling us that the formulas don't apply in the massless case.
Fortunately we also have these two equations in SR:
##(mc^2)^2 = E^2 - (pc)^2##
##\vec p = (E/c^2) \vec v##,
both of which DO apply in the massless case.