What to do if my undergrad hasn't prepared me well for grad school?

Just a guess, but the guess is that you are uniformly underestimating your own skills and the quality of your education. You say "When an author derives something, I sometimes need a few minutes to make sure that the math is sound." Well, it might take me hours or days.

You are undecided about field and find a lot of interesting things that you might study. This is natural, but could be a block, since doctoral study is all about specialization. So, pick something that seems the most interesting to you and that seems to have some future possibilities. Apply to a program that is good in that field and find an advisor. You will be led toward specialization over a year or so and your research will lead you deeper.

There are two hard parts to research (well, maybe three). You need to find a suitable problem and you need to find a way to resolve it. (The third is, in some fields, coming up with a methodology for the resolution). An advisor can be helpful, especially, in coming up with a problem - or at least suggesting several, or pointing you at places that might be hiding problems.

But you won't know until you get into the thick of it.

And, for all of the "other" cool things that you leave behind by specializing, they aren't closed off from you forever. But first, get a doctorate so that you again have freedom to pursue whatever interests you.

Some people (myself) have changed fields quite drastically for many reasons. Some because of the academic economy at the time, but others (not me) have actually invented new fields. Some just followed their thoughts and branched off into a new area.

As a researcher you are currently unformed. The forming will come through practice and with the (hopefully good) guidance of an advisor.

Narrow your focus a bit. Apply to a good school. Find a good advisor. Work hard. Hopefully success will come, but satisfaction probably will in any case.


I don't feel like I have the background to actually do research

Undergraduate degrees do not (generally) prepare you for research. By teaching software development and neglecting the mathematical side, your school prepared students for the workplace, rather than academia, which is their job.

How can I make sure that I'm ready and in the right field when I start applying for grad school?

Apply, learn what you need once hired, and hone in on your field as you go.

Ultimately, [t]here are too many interesting areas and not enough time [nor] energy to learn all of them. That's not a problem, you can just learn what you need. Your supervisor will help you.