If everybody gets to live a very long time, then we run out of resources
That entirely depends on the birth and death rates. Eliminating aging won't keep you from dying when a bus hits you. And we've found over and over that when people live comfortable, middle-class lifestyles with a proper education, they generally don't want to have a ton of kids any more. Every western country (plus Japan) is experiencing ZPG right now except for immigration.
If we figure out how to curb over-population and only the really old live, then we run out of viable sperm and eggs in a few generations
You're assuming we won't figure out how to reproduce artificially. That's a really bad assumption. If we can figure out how to stop or reverse aging, you don't think we can figure out how to continue to reproduce with artificial means (or even how to rejuvenate the gonads)?
unless we figure out how to dodge the who reproduction via sperm and eggs thing
Lots of people are already doing that: IVF, frozen sperm and eggs, etc. If for some weird reason we can figure out how to reverse aging in every part of the body *except* the testes/ovaries, you don't think we'd just automatically freeze people's sperm and eggs when they're young?
One thing that could potentially change this entire equation would be extending the range in which humans can live, whether it be orbital habitats, terraformed planets or cozy lintel asteroids.
I don't see why those things couldn't be built. We're just too lazy to make them right now, since we'd rather fight wars with each other over religious idiocy and the like.
But even before any of that is doable, the population thing is a red-herring. Most likely, anti-aging treatments will be expensive, so will be confined to wealthier people, which mainly means westerners, and richer Asians. These people are *already* not having many kids. All the western nations would have to do is stop all immigration, which would immediately give them negative population growth (with current conditions), and then with much greater lifespans, they'll have zero population growth, or maybe slightly positive.
It's not like anti-aging treatments are going to make everyone suddenly want to emulate the Duggars.