I do research in math. A lot of times, I get stuck. I wonder if it's considered ethical to post questions on which I get stuck on internet sites, for example Math Overflow or Math Stackexchange. 

If the question is just a small step or something already well-known, it is probably a waste of time to reinvent the wheel myself (and I don't get credit for doing so.) On the other hand, if it turns out to be a crucial step, then I could potentially be dishonest if someone on the internet solves it and I claim it's my own work. Sometimes it's not easy to tell beforehand which case the question will fall into.