Thanks man. Unfortunately the handlebar wasn't the only thing that rusted off or otherwise broke. RIP the bike I used when I was a younger and more hopeful person.
You have to abuse a bike pretty damn badly for it to truly be unsalvageable. Either you're too lazy to fix a fixable bike or you were so lazy you neglected the poor thing to death, so either way, that's on you.
But seriously, I've seen roadies rust through the drops because of the way shifters clamp and tape concentrates a ton of alkaline salts if it is not changed often. I was the Buyer for a chain of 3 shops for 6 years. I've seen thousands of bikes and issues from service stuff. I've never seen a grip break off. Looks like a steel bar, which would be low end and quite old as aluminum has been standard for a long time. Probably left outside. Still fun to see, just to say I have.
There's a detachable penis joke somewhere in there.
Yeah. Your bars (handlebars) are attached to your head set and head tube by your stem. The stem should have some bolts on it you can undo. Once they're gone you can remove the bar. Then it's just a matter of getting a new one that's the right diameter and sticking it back in.
Bikes are great. Anybody can fix a bike and there are tons of replacement parts all over. If this repair is too daunting you could always take it to your local bike shop to ask for advice, or, if you live in a cool town, there might be a "bike kitchen" around, which is usually a volunteer-run org that helps folks fix their own bikes and often has used parts bins for cheap replacements as well.