This answer is meant to apply to graduate students (like the OP).
Talk to your advisor. She is the designated person to help you with your research. You should do so because:
1) Your advisor will probably have some help to offer. Give them more than one chance to do so, and be clear in communicating how much help you want/need at any given time.
In your case I believe you said earlier that you talked to your advisor and got some but not enough help, because she only thought about your problem when you were there. To me that is the opposite of strange: being a thesis advisor myself, I recognize it as the classic tension inherent in the job. How much help do you give the student? How much time you do spend thinking about the student's problem so as to be able to give help? There are usually no easy answers to these questions. Even in dealing with the same student, over time I often find myself: giving too much help; giving too little help; being put in a situation where the question they ask is too hard for me to give an answer on the spot and then having to try to find time for outside thoughts about their question.
When you talk to your advisor, make sure she understands that you feel so stuck in your research that you are considering seeking outside help.
2) If you get outside help without telling your advisor about it, it could be embarrassing to her.
It can be tough to ask the same person for help on the same thing more than once. But it is part of the advisor/advisee relationship. If my students showed up on SE sites asking questions that I feel that I could have answered, I would not feel great about it. (Most of my negative feelings would be directed to myself rather than at them, but still: not great.)
3) If you are truly stuck, your advisor needs to know. It very often happens that the best thing to do is to switch to working on a different aspect of the problem, or perhaps a different problem entirely. Your advisor is the one to help you with that.
Let me also say that in the realm of mathematically-related research, two weeks is a fairly short amount of time to be working on something. If after two weeks you are completely out of ideas and don't even know what else to try, then you should address that. If you simply haven't proved the "major theorem" yet: join the club. To prove a major theorem usually takes me at least two months; two years is not at all unheard of, and is not a maximum. As long as you're making some progress thinking about the problem, I don't necessarily see anything wrong here.
Added: The lack of directness of my answer was intentional, but let me add one comment. In my opinion the greatest risk in asking in the internet community for help in solving your mathematical research problem is....that someone will solve your mathematical research problem. As mentioned above, your advisor is optimally briefed in the matter of how much help to give you / how any one question fits into the larger scheme of your research program, and still advising a student is a matter of successive errors and corrections (i.e., helping too much and too little). Being a PhD student has a highly egoistic aspect to it: you are not just trying to find solutions to problems; you are trying to find them yourself. There is a real risk that the right expert will simply leave you without a problem to be working on. This is why talking your advisor is so critical: she may in fact decide at some point that asking for help is best, but in that case she will know exactly what and whom to ask in such a way that the rug is least likely to get pulled out from under you. This is very important!