How does a mathematician know if what they are trying to show or what they are working on has already been shown by someone else, or has already been extensively studied etc.?
What if instead someone has already proven a much stronger result, for which their result is just a special case so though while no one has explicitly written about their special case it follows from the stronger generalization already known?
Also how would they know if maybe their result is actually just trivial to people highly specialized in the field of study they are working in, so though while no one has explicitly ever published anything on it, that was simply because those really deep in that area could prove it trivially?
My thinking is basically those interested in whatever area they are working keep track of journals that publish stuff in that field. But how would you know which journals do that? Are there just like a crap load and you have to keep tabs on them all? Is there something more centralized people look through? But even disregarding this, for the sake of argument if we assume they have "access" to all the work in their field, how would they know how to sort through it to make sure what they are working on hasn't already been well studied etc. with their result already known? What if after searching with every keyword they could think of they still find nothing? What would they do then?
If for example you said the hell with it and just put it out there through a journal or something, and it later turns out it has indeed already been proven, would that reflect badly on you? Can/do you "retract" the paper (not sure if thats a thing) once you know about it?
If theoretically something published could reflect bad on you, could/do people publish under fake names and then if it gets attention re-attach their real name? Or is that like ethically bad? I mean can you even do that? I imagine some fancy journal or whatever would want confirmation of your real identity or something, right?
Do people get taught how to do this specifically in grad school or whenever they start trying to do research? I imagine its changed quite a bit with the widespread use of the web in the past $25$ years. Can any professional mathematican answer if they were taught specifically by someone at a university on how to do this, when they first started doing research?
Did they have like an advisor sit them down and be like "Okay so you try to do this and you look here and then you want to make sure blah blah" or was this something you picked up on your own?
I imagine any practicing mathematician would have had to adapt with the increasing use of the internet, so even if they were taught how to search for stuff through books say in the $1990$s they had to learn on their own how to do it with the web after graduating and being on their own so to speak. Can any older mathematician here tell me how they learned to do this by themselves?