What do I even do with my life?

I'm mid thirties, live in a tiny apartment, and I am in school. I'm doing advanced degrees in mathematics because I love it. That is pretty much the only positive in my life. Other than that I have no friends, no social activities, nothing else to do other than walk around my city and watch movies. There are a few people at university I talk to on a regular basis only seemingly because we're doing the same thing.

I have always wanted a wife and kids, but this is unlikely at this point. I am too old and poor, and probably wouldn't make "decent" money until my 40s. I am also socially retarded and can't talk to women, or anyone really. Most conversation feels pointless.

I've been asking myself lately... "What is this all for?" It seems like nothing. I get intense and pure emotional and mental satisfaction from my work, but other than that my life is completely empty and if I am not doing mathematics the emptiness is suffocating and painful. I'm not sure what to do or where to go, I can't escape it. I have been considering suicide lately. I just don't know what the hell I'd even do for the next 30-40 years. More of the same emptiness? Fuck that.