I've been considering applying to graduate school of some form or another in Mathematics. During my undergraduate years, I did decently on my undergraduate coursework (mostly A-s, some As, a B) but not stellar, and it wasn't underuntil I started taking graduate courses as a senior that I started buckling down and getting solid As or higher. I also had no research experience at this time.
I eventually want to apply to a Ph. D program in pure mathematics. Since I didn't really click until later in undergraduate years, so I was considering applying to 2-year masters programs in mathematics, and then based on my performance there, decide whether I'm fit to work towards a Ph. D.
My question is, what are the advantages and disadvantages to completing a master's program before applying to a separate Ph. D program?
I know masters degrees are sometimes considered terminal degrees. Would doing well in masters coursework be advantageous in applying to Ph. D programs later on as opposed to immediately after undergrad years? Does strong performance as a masters student make one a more attractive candidate, or do programs have less interest in applicants who already have a masters? Is it wiser to apply for a Ph. D directly? I'm sorry if this question is considered too much of a soft question. Thank you.