Well I didn't have a clue when I applied to grad school. I liked a beautiful book by Hurewicz and Wallman on dimension theory and I mentioned that on my application, just to have something to say, and not knowing the subject was basically closed for decades.
Then in my first year at grad school I was amazed by my algebra teacher Maurice Auslander and wanted to work with him. But he was teaching algebra with an orientation towards algebraic geometry, and when i said i wanted to work in algebraic geometry he said he was not a specialist and i should work with Allan Mayer who was.
Then the next year I took a course with Alan Mayer in algebraic geometry and was blown away by it. I loved it. So for me, the professors showed me what I liked. It is hard to pick a research topic in undergrad, if like me you were still learning really old and/or elementary stuff.
So its sort of an exploration and at a certain point you go, Wow, I want be one of those guys, or I want to study that subject!
In my case I did not finish with Alan, even though he was very helpful, due to distracting influences from the vietnam war. I took a break and then a few years later Hugo Rossi kindly recruited me to Utah and taught me a lot of very valuable complex analysis of several variables, and then I met the brilliant C.Herbert Clemens, who put me back on the path I had been in love with of classical algebraic geometry of curves and Jacobians, and guided me patiently and generously to a thesis.
I was very lucky. All my career by the way I have mascaraded as an algebraic geometer but really functioned and thought as a several variable complex geometer thanks to the training from Hugo and Herb. I also benefited enormously from postdoc training with Philip Griffiths, David Mumford, and Heisuke Hironaka.
While hanging around with those guys, one meets also as a consequence, an incredible list of amazing people like Bernard Tessier, John Fay, Mori, Mattuck, Kleiman, Hartshorne, Kolla'r, Barry Mazur, David Kazhdan, Igusa, Freitag, Bott, Tate, Mike Schlessinger, Saul Lubkin, Johnny Wahl, Mike Artin, Miles Reid, Frans Oort, Białynicki-Birula, Eduard Looijenga, Steenbrink, Boris Moishezon, Serre, Dolgachev, William Fulton, Murre, Wolf Barth, Herbert Lange, David Gieseker, George Kempf, Nori, Andre Tyurin, ... it just goes on and on. I could write down a list so long of brilliant people who have helped me that it would easily exhaust the character limit of this post.
If you go to meetings as well as these top places, you also meet younger people, and brilliant students of these icons, Joe Harris, David Morrison, DeConcini, Ciliberto, Ziv Ran, Jim Carlson, Rob Lazarsfeld, Enrico Arbaello, Maurizio Cornalba, Fabrizio Catanese, Gerald Welters, van Geemen, van der Geer, Arnaud Beauville, Olivier Debarre, Ragni Piene, Rick Miranda, Bob Friedman, Ron Donagi, Robert Varley, Valery Alexeev, Elham Izadi, Werner Kleinert, Edoardo Sernesi, Igor Krichever,... and it blossoms for you as well.
And now there is another generation of people who have more recently helped me; Ravi Vakil, Sam Grushevsky,...
This is truly but a tiny fragment of the people who have kindly taught me this subject, and I apologize to the many I omit. Literally every time I close this post more names crowd to mind. But my point is not to list them all, but to show you that you are not alone, you get a LOT of help.
The benefit of speaking or even listening to these people is immeasurable.
The moral is: Work as hard as you can to acquire some skill and knowledge. Then go to some math meetings as soon as possible, and meet people who are active in the subject you are interested in. You will be glad you did. The more people you meet the more they will contribute to your own work. Once you get on your feet and to a point where you can benefit from their conversation, you will be amazed how much you learn from talking and listening to other people.
If you want to understand topology, talk to a topologist, if you want to understand resolution of singularities, ask Hironaka, ... you get the idea.
For an online version of these conversations, check out mathoverflow now and then. there are many very knowledgeable young and senior mathematicians there sharing their knowledge, but only on a level above what you should find in books yourself. But there is no penalty for reading answers to other peoples questions. And even if your question is too mickey mouse for them they will just close it.