What are the best courses to take if I want to end up doing research in metaphysics?

Metaphysics is the branch of philosophy that seeks to explain the nature of being or reality as well as the origin and makeup of the universe. Different branches of metaphysics deal with the questions of (among others) free will, perception versus reality, the nature of change and time, and religion.

If you hope to devote your life to metaphysical studies (or any philosophical study), the two things you need that you can learn in school are logic and the ability to think and write clearly.

Logic is the basic tool of philosophy. You might say that logic is to philosophy what math is to science. If you want to make any headway in philosophical proofs, you must be able to express ideas in a logical form that makes your conclusions apparent to others. So take some logic courses as soon as you can.

Most "output" from philosophers is the printed word, so you also need to be able to express yourself clearly. Take some writing courses to hone your ability to present your ideas clearly and logically.

But you don't have to wait for the right courses to open up to learn what you need most to be a metaphysician; you can do it on your own. Philosophy is all about thinking about things in different ways. Sometimes, it's thinking about the simplest things in complex ways; other times, it's imagining the most complex things in simple ways. You need to exercise your brain and learn to stretch it in new directions.

Getting a good foundation in philosophical history can condition your brain to approach a problem in different ways, as well as reveal what ideas have come before. This means that you need to pick up some books! Read a few books about the problems of philosophy in general before moving on to the more specific questions of metaphysics. Then, when you're ready, dip into the metaphysical works of Aristotle, Immanuel Kant, David Hume, Bertrand Russell, Ludwig Wittgenstein, and others.