(1) It depends a lot on the field. In fields that rely on specialized techniques discovered relatively recently or known only to a few, or fields where the questions involve recently-introduced objects, it's much easier to keep abreast of current research.
On the other hand, in fields with elementary questions that could have been studied a hundred years ago, sometimes even senior mathematicians discover that their work was studied a hundred years ago.
Of course, working in a trendy field carries its own risk, that someone else could be working on the same thing at the same time, but not much can be done about that.
(2) If you're working in a specialized field, as other have said, the best thing is to ask your advisor. If you have an advisor in a specialized field and have ideas in a different field, the best thing would be to ask someone in that field. As a grad student you probably want to start with fellow grad students, but a senior mathematician would probably asks someone on their own level.
If you have an idea that is more elementary, you should still ask your advisor, but there are certain mathematicians who know a lot of elementary and classical mathematics you could potentially ask.
(3) With regards to literature review, one trick that helps a bit when keyword searches fail is to use citations. If your idea generalizes work of Paper X, or answers a question from Paper X, or uses in a fundamental way the results of Paper X, anyone else who had the same idea would likely cite Paper X. You can produce a list of papers citing Paper X on both Google and MathSciNet.
(4) As a starting graduate student, even if your idea is completely new and original, it is likely that the greatest value it provides to you will be as practice for your future work. (I mean if you're good enough to do groundbreaking work right off the bat, you will probably do even more groundbreaking work once you get some experience under your belt.)
So don't feel bad at all if you find out something was already well-known - the experience of formulating and solving your own problem makes you well-placed to do original research once you learn a bit more, as compared to someone who knows a lot but hasn't done this.