The sociological and metamathematical aspects of this question are too often overlooked, I think. First, undergrad or grad students' discussions with their peers too often subtly veers into a "Lord of the Flies" scenario. Second, many "advisors" (whether undergrad or grad), have some weaknesses in communications skills and in perception of others' non-verbal expression (e.g., affect). Nevertheless, yes, one should talk to faculty quite a lot (even if taking remarks with a grain of salt).
Now some objections: the labels of "subjects" or "specialties", while seemingly sanctioned or even mandated by the AMS subject classification, by faculty "research descriptions", and grad students' desires to taxonify ambient activity, are innately misleading. There are no clear separators... except those artificially imposed. True, the "requirements" have such labels, and "everyone" speaks in terms of them, and... yes... one can live one's whole professional life speaking in those terms, ... but this partitioning is fundamentally invidious.
The next objection is that it is usually very difficulty to understand the significance of things until one sees how they're used "in the sequel". Thus, a misguided fixation on "mastery" at an entry level really is misguided, in that one is doing exercises without a notion of real-life activity. The utility of things is not well-illustrated by contrived (a.k.a., "textbook") exercises.
These remarks are all cliches, but perhaps bear repeating...
Edits: Seeing the responses, I'd like to add clarifications. First, one should not depend on coursework for learning mathematics, especially not for seeing how it is done in real life. One must learn more-and-different things than what the traditional curriculum promotes, no matter which courses one signs up for. One special corruption is the usual convention of assigning piles of weekly homework, exams, grades... leaving people little time or energy to think critically about anything, and confusing compliance with scholarship. (Observe: in mathematics, apparently one is not permitted to question the goodness of course content, insofar as grading systems reward obedient technical responses rather than critiques.)
Far more important is awareness of things, of their utility, of their interactions with other things. Earliest-possible awareness of as many ideas as possible is highly desirable, whether or not piles of exercises are completed.
Thus, it is desirable to "look at everything", and obviously this can't happen via coursework. It is desirable to witness the actual practice of mathematics, thereby to be aware how different doing mathematics is from doing homework or exams or contest problems. Seminars sometimes represent this, although often they amount to reports or job talks. Regular conversations with faculty about mathematics, not about coursework, surely cultivates a more useful outlook than any amount of coursework.