The utility of graduate math study for theoretical physics This is question that should primarily be answered by theoretical physicists, as mathematicians always are going to want to say to take more math.

I am going into my third year of undergraduate study major in math and physics and I hope to eventually end up in a good theoretical physics PhD (probably cosmology or particle physics). I have the ability to add a year at my current institution and do a masters in math, and I am trying to figure out if pure math at a graduate level is interesting/useful for serious theoretical physics.

Some classes I would be interested in taking as part of the degree would be (all grad level) Functional Analysis, Complex Analysis, Lie Algebra, Differential Topology, Riemannian Geometry, Theory of ODEs, Theory of PDEs, Operator Algebras, Real Analysis, Topology, Algebra (a lot of these classes are two semester sequences).

I am interested in hearing how useful people think having such a formal mathematical education would be to doing the physics. I am primarily interested in very foundational physics, and I am concerned that the brief treatment the math is given in physics books will prevent me from having a full understanding of the math at play in fields such as QFT and some the more out-there cosmology. I of course understand one can self-study some of these topics, but it seems fairly clear one would get a deeper appreciation by actually taking the courses in a proper academic setting.
You need to distinguish between a few different styles of theoretical physics, which differ dramatically in their math requirements. 


Particle phenomenology and theoretical cosmology. These are the people who use math to make predictions about our universe. They study things like dark matter, inflation, (low-energy) supersymmetry, baryogenesis, grand unification, etc., and often talk directly with experimentalists. (hep-ph/astro-ph on ArXiv)
"Formal" theory. These are the people who play around with neat theoretical toys like supergravity, AdS/CFT, strings, twistors, etc. without worrying much about whether they have anything to do with our particular universe. (hep-th/gr-qc on ArXiv)
Mathematical physics. These are the people who try to put physics on a firm mathematical foundation. The Navier-Stokes and Yang-Mills Millenium prize problems fall under this category. Many professors who work on this have stuff have joint appointments in the math department. This camp is much smaller than either (1) or (2). (math-ph on ArXiv)


Lumping them all into "very foundational physics [...] such as QFT" and "formal/pure theory stuff" makes it sounds like you haven't learned enough physics to know what you want yet. All of these groups will use QFT, in very different ways. You should talk with professors and grad students who do each of these things and look at papers on the ArXiv to see what catches your interest. 

If you want to do (1), you'll probably need to pick up differential geometry, group/representation theory, complex analysis, Lie groups and Lie algebras, and the very basics of algebraic topology (i.e. what a homotopy group is). The most efficient way to do this is to read math books written by physicists for physicists, which are listed here. If you take pure math courses on these things, as I have, you'll find that what the mathematicians care about is very far from what physicists care about! About 80% of the material in any given course will be irrelevant.

If you want to do (2) it will depend on exactly what you're doing, but it wouldn't hurt to get full year-long courses on differential geometry, algebraic topology, and algebra under your belt, in addition to the material in (1). Most PhD students have done this or done the equivalent by self study. While you'll rarely see math-style proofs in such papers, they will use the language of pure math, and the benefit of the courses will be acclimating yourself to this language. If you want to do (1) this background can still be useful because it makes papers from (2) much more accessible. 

If you want to do (3) you'll basically be a mathematician, so you should take everything you mentioned and ideally enjoy it very much. You'll need more advanced graduate courses too, though which ones will depend on exactly what you're doing.

If you have more questions, feel free to drop by the Physics.SE chat room where we have people in all three camps!