When should you, and should you not, share your mathematical ideas? Perhaps this is a biased forum for this "downer" question, but I've never figured this out. At what stage is it safe to share mathematical ideas? Many have told me that there is serious danger of ideas being stolen if shared in a premature form, but I've found that sharing ideas often moves things along much more quickly than holding them back.
This is definitely not the best question for MO, but I think some expert advice on the topic may be helpful to young mathematicians. 
 A: Well, a personal anecdote, I worked with a famous guy for some years. His basic strategy was to mail, on paper, anything publishable in a draft to one or two dozen parties that might be presumed to be interested. If nobody replied inside a month he submitted it somewhere. The point, in my mind, was that if one other person sees your stuff early you may get robbed, but if 20 see it early they are all witnesses. Later they came up with the arXiv.
The other, well-known side, is that if you share your stuff with the top expert in the field, that person may send you back a note saying "that was fun, here is the answer" and promptly forget all about it. You have not been cheated but there is still a problem. 
EDIT There seem to be mixed impressions of what I meant in the preceding paragraph, and for whom the situation would remain a problem, so maybe I had better describe my own experience again. I have told this story many times, with names, and I think the story only does people credit, but I think on MO I ought to stick to anonymity. Email me if you want more detail. In graduate school I was working on minimal submanifolds. My adviser came up with a fairly specific problem, suggested I work on it, and asked one or two guys in the same department if they thought it was new, which they did. It still took me some time but I was getting there. My adviser was away somewhere giving a talk, and, once again, mentioned the problem to a guy. The difference was that this guy is a leading light in similar problems, went home, solved my dissertation problem in one evening on some 30 pages of notes, and put those in a drawer and forgot all about it. But at some point he happened to mention to my adviser that it was a good problem, he had completely solved it. My adviser mentioned this to me, and I was terrified. How could I submit this as a dissertation if this other guy solved it already? At some point I contacted him, he said, don't worry, it's your problem, I don't need it, you just finish it up and it's your dissertation. Finally, after  I finished, I did ask to see his notes, he found them eventually and sent me copies, but even between him and his adviser at the 1992 Park City summer program no sense could be made of the notes by anyone concerned.
So I suppose I would say, along with Kevin's comment, that the nature and severity of the "problem" when the world champion in your area solves your problem in an afternoon (but has not the slightest intent to publish, ever)  depends on your position and how much you need this as a publication/dissertation and how critical it may be that the work be perceived as your own and original. I may have misunderstood my position in graduate school, and everybody behaved well in my opinion, but it was certainly scary. I think I do see Kevin's point that, as a journal referee, he is often confronted by work that is already known, "in the air" as they say, or where the most likely techniques are pretty obvious as soon as the statement of the theorem is read, but he will still accept it for many journals.
I think it is fair to say people pick and choose what of their stuff to put on MO. This is probably healthy. We should struggle rather than getting handed everything.  
Given that this question is Country and Western, I am taking this opportunity to point out that I went to high school with Paul Ginsparg, founder of the arXiv. He was a year older. It is a good bet that he is still a year older. Also Natalie Portman.
http://en.wikipedia.org/wiki/Syosset_High_School 
http://en.wikipedia.org/wiki/Paul_Ginsparg 
http://en.wikipedia.org/wiki/Natalie_Portman 
A: While I feel lame writing "actually, you should read about this on my blog"...
Actually, you should read about this on my blog.  There's quite a serious an interesting discussion in the comments section.
I would say the one sentence summation is "it's never safe to share your ideas, but it's never safe to not share them either."  This simply isn't a question with a right or wrong answer; I think it's better to err on the side of openness, but it is not without pitfalls.  
One point I would add to the discussion there is just how darn hard it is to steal ideas; it's hard enough to figure out what's going on in a paper when it's written up.  Generally, the person who came up with an idea has enough of a head start that it would be more work than it was worth to try to steal their ideas.
A: My advisor gave me advice which I have found very useful (and which is largely in line with Ben Webster's response): 
"By talking to other mathematicians about your work, you will generally gain far, far more 
than you will lose."  
He saw isolation as one of the biggest risks for a young mathematician.  I have followed his advice, and nearly all of my papers have benefitted from the suggestions and insights of other mathematicians.
A: I can think of one situation where sharing your ideas can be dangerous, and it is when you have formulated and proved a conjecture that is hard to synthesize but easy to prove.  If you haven't written and submitted a paper, sharing the idea may make you vulnerable to people who write quickly.  This happened to a colleague of mine - the other person's paper only acknowledged that she had formulated the conjecture, but not that she had proved it.
A: One thing that does not seem to have been emphasized in the other answers so far is that it matters quite a lot who you share your ideas with.  There are some people that should be avoided.
In graduate school I solved a problem that had been circulating in the department for a while.   Before I had had a chance to write it up formally, someone (more senior than myself) who had tried unsuccessfully to solve it asked me to explain my solution to him.  As I started to explain my solution, he would repeatedly interrupt and say, "Oh I see now...this is what you do."  Then he would start talking and writing on the blackboard.  When he got stuck (because he didn't really see how to solve it), he would then stop and invite me to continue.  The scenario would repeat.  He would also criticize my presentation.  The whole time, he acted as if he didn't believe that I had solved the problem, and seemed to be trying to get me to give him my ideas while behaving in a way that would allow him to say afterwards that I had had some good ideas but had not really solved the problem and that he was the one who had really solved it.  I don't know if he was doing this intentionally or whether this was just his personality, but needless to say, it was a very unpleasant experience and I avoided sharing my ideas with him from then on.
While in general I am a fan of sharing ideas, I think one should be aware that there are people out there who (consciously or unconsciously) do steal ideas.  They are rare (the above person is the only one that I explicitly try to avoid sharing ideas with) but they do exist.
A: Thus far, the responses about the negative aspects of sharing only discuss idea "theft."  This would seem to apply mostly when the ideas being shared are already publishable, near publishable, or at least very likely to lead to something publishable.  The biggest danger I have ever experienced with sharing occurs earlier in the process and has nothing to do with theft.  It is to enter the following pattern:
(1) I share an idea or problem with somebody before I have really given myself time to marinate in it.
(2) The other person introduces their own ideas--- and is so persuasive, or detailed, or optimistic about their own views, that I get caught up in them.
(3) I lose the thread of my original idea and/or spend a long time fruitlessly trying to attack my own problem with somebody else's way of thinking.
I'm not saying that my way is always better or leads to the right thing, and that the only thing stopping me from publishing great results is distractions from lesser minds.  I am saying that sometimes you should not share your ideas until you are either well and truly stuck, or far enough along that you could give a coherent (if detail-free) seminar talk about them.  You need to know enough about your own ideas that you can put them down for a minute and compare them with someone else's without information loss.  When this is, exactly, changes from person to person and problem to problem.  But if you share too soon, you run a risk of spending a lot of mathematician-hours checking the details of somebody else's half-baked idea before you have even checked your own.  I think grad students are generally more in danger of this than they are of idea theft.  (It is easy to unconsciously take an established person's educated guess for "expert wisdom", even when it is not intended as such.)
A: Always, the knowledge should be shared. The individual credit is not important, the important thing is that the mathematics grows up, independently who did a particular contribution. 
