How to know if somebody else is also working on your problem? Once you have spotted a mathematical problem that (presumably) fits your degree of expertise, whether you are a phd student or an established professor, you have to deal with the following non mathematical problems:


*

*How to know if somebody else in the world is already working (or has already been working) on the same problem? 


If the other guy has already completed a certain amount of (say, not yet published) work on that specific topic, knowing this would help you to avoid waisting time to try to re-do something that has already been done (at least with the same methods).
On the other hand, if the problem is broad enough, knowing of some other's interest in the same context would also be fruitful because you'd may have somebody with whom to talk and to whom to ask questions, without overlapping the specific research goals. Or you may even find a collaborator.


*

*In some cases the very choice of an interesting specific problem can be a nontrivial task by itself. So, in case you want to ask around if some previous/present effort has/is been made in that specific direction or related ones, should you worry about the possibility that somebody with a higher degree of expertise would just "take your problem" and solve it faster than you would do? 


I'd expect the obvious answers, such as "have a look to mathscinet/arxiv" or "search the literature" or "talk to people (your advisor if you're phd)", to be enriched -if possible- by some more elaborate viewpoint or more specific suggestion.
 A: This is likely to be an issue where there's a huge variety within sub-subfields.  These days I'm mostly working on fusion categories and algebraic aspects of subfactors.  Within the broader field of quantum algebra and quantum topology, these are a much smaller subfield than say Khovanov-style homology theories/categorification of quantum groups.  As such, I don't have to worry as much about competition, and basically know who would be likely to be already working on any particular problem.  In more crowded fields this is going to be much harder.  This is one of the things I like about working on a less crowded topic.
A: As others have indicated, the only 100% effective method of preventing getting "scooped" or finding out that your result already exists in the literature is that of complete abstinence: i.e., not trying to do any research at all. 
Obviously this method is far too draconian for most of us on this site.  I want to support statements of Gowers and Nielsen: finding out that what you have just proven has already been proven by someone else is far from the worst thing in the world.  (Finding out that what you've proven, or published, is false, is much much worse, for instance.) On the contrary, for a mathematician who is making her own way and working on problems of interest to her, if you are doing any good work at all it is inevitable that you will duplicate some past research.  This can be very encouraging: when I was younger, I often lacked confidence that some things which were of interest to me were of sufficient interest to anyone else (all I knew at that point was what people near to me were doing).  
I remember in particular that as a first year graduate student, I discovered that every profinite group is, up to isomorphism of topological groups, the automorphism group of some Galois extension.  This seemed neat but I thought, "Well, if anyone really cared, I would have heard about it before."  Wrong -- this result has been published several times; off the top of my head by Leptin and by Waterhouse, but I know this list is not complete -- and in some texts (just not the ones I knew about at the time) it appears with due respect and appreciation.  When I found out that someone had written and published a paper containing exactly the same mathematics that I had done, it was very encouraging.  
A: Since you mentioned "the obvious answers" I thought I might repeat one of them: search the literature.  As a new graduate student I starting working on a problem and even solved a neat special case, but then came to find out that it had appeared about 20 years earlier.
Fortunately for me, this didn't discourage me, and I started working on a harder case.  Strangely enough, about the next week my advisor told me of a conference he had just gone to in which it was announced that this harder case had been solved!  So I guess method two might be: know who is working on these problems, and attend conferences.  Talk to the experts and see what they think about the problem.
Again, fortunately this didn't discourage me and I delved into their proof, found an unfixable hole, and eventually found a correct proof.
To be frank, sometimes it is a good thing to work on the same problem as someone else.  You get your own intuition about the problem.  But if you worry about being scooped, and need publications, try method three: work on a problem that is very specialized, and not highly publicized.
A: Recently I'd started working on a project with a leading expert in the relevant field where the result we'd worked on turned out to be already in the literature unbeknownst to either of us.  So this can happen even to leading experts.  (Our method of proof was slightly different, but that part of the project instead of being a new result just becomes the pushout of a known result with a known technique proving a similar result, and so not really worth publishing.  (Though it was still a project where I learned valuable things!)  Fortunately we hadn't actually started writing.)
So how did we figure out that this result was in the literature?  One day I decided to read the mathscinet reviews of every paper with primary subject classification 46L37.  The reason I did this was actually to try to learn where subfactor papers were published, but a nice side affect was that I learned about this prior excellent work so we didn't put in a bunch of effort only to discover that someone else had done it several years ago!
I highly highly recommend at least skimming through the mathscinet listings of subject classifications that you tend to publish in.  It really gives a nice birds eye view of the field (albeit a couple years out of date).  (Of course, this is easier to do in fields that have only existed for 30 years.)
A: This answer probably does not apply if you are an "established professor."  One good way that this is accomplished is by discussing your work in progress with the experts in the field who will hopefully be kept up to date on what other people are working on (since they are also keeping someone in the small group of experts up to date).  In particular, if you are a Ph.D. student this is one of the big reasons you have an advisor!  (See Allen Knutson's webpage.)
A: Actually the question might be most interesting when one is neither a PhD nor an established professor. I would like to know the answer myself, but one thing I try to do is to read a lot of conference abstract in areas close to what you are doing. For my field, which is commutative algebra, there is a nice website which has a pretty comprehensive list of conferences, and I imagine other areas would have similar sites.
Other than that, one could try to do the normal things more thoroughly. Say, if I am working on some problem about "local hypersurfaces with isolated singularity", I would also search Math Sci Net for "smooth projective hypersurfaces" as well. I have learned quite a few useful things that way. And don't be shy about approaching people you don't know personally with questions about your or their work, even via emails. I found the majority of people are happy to tell you what they know. 
Finally, one way to find out if other people are working on the same thing as you do is to advertise what you are doing. So putting your pre-prints/slide on arxiv and your website and give as many talks as you can would presumably help.    
A: I'm surprised that no one has posted the following response yet:
Post a question on MO asking what is known about your problem.
I'm curious to hear people's opinions about this.  Is this within the intended purpose of MO?  In a sense, this is certainly a "research-level question".  Some people may be more cautious about broadcasting what they're working on, so as to avoid attracting others to the problem.  But we certainly have a large community of active mathematicians here, and one might gain a lot of insight from the answers to such a question.
