Getting a Postdoc, Dropping out of PhD for Greener Pastures (I hope), or else Staying Competitive in Current Position
How do I let go of the "once in a lifetime" PhD position I could have had?


This is far beyond the scope of mere academics. Life is full of choices, some of them will be bad. Some of it is in our control (in retrospect, hindsight is 20/20 always) and some if it is not. 

I think that apart from going back in time - there is nothing that you can do. What you can do about your situation now though, is talk to someone. 

You are not alone in this. 

I had suffered (and perhaps still am suffering) from impostor syndrome at times, and I know that I could've done much better if I had made better choices. 

It's good to have someone to talk to about these things. This could be a trusted friend, a loved one, or a trained professional. There is no shame in seeking help! Universities often have excellent mental health services, and graduate students are a vulnerable population in terms of mental health (not alone, remember?). 


  What do I do to become a marketable mathematician? How do I get a postdoc?


The academic world has very clear rules on what could make you a marketable academic: publish good papers or preprints, impress some well-known people in your field, present your work at respectable venues, get amazing teaching evaluations that'll land you a lectureship, be an active member of your research community and so on. 

If you feel like your current (unmarketable) field is not sufficiently exciting, and you aren't making progress, switch. I have done so twice in my career (and I would like to think that I'm not incredibly old!), and many others I know have as well. What were papers that you read that made you really curious and excited? What skills have you acquired that may help you along the way? 

In the professional realm, again: seek advice and help. What does your advisor say? I'm assuming that your relationship with them is not at 100% (else you wouldn't be asking this question here), can you try to make it better? Are there mentors in your department that you look up to? 

If you are dead set on staying in academia, the reality is that you'll have to extend your time to accumulate a better portfolio (especially if you want to switch fields). Either extend your PhD if possible, or get a temporary research position. I don't know the postdoc culture in mathematics, but perhaps a lower-tier research assistantship would be within reach?

Good luck!