Do I have to make someone coauthor if he/she solves a problem in StackExchange, asked by myself, which is later used in my paper? Suppose, in my research (mathematical) I have a critical step that I need to solve, and, due to various reasons I cannot find decent answer to that step by myself or by contacting friends or colleagues, so that I decide to post a similar but simpler problem to the relevant StackExchange (Math). Now, if someone comes up with a good answer that I can use to further my research, will it be enough to acknowledge the contribution of the author of the answer and citing that particular thread of StackExchange, or do I need to include that person as a coauthor of the paper that I might prepare based on that answer? 

I emphasize here that the paper is supposed to be not all about that particular result, there are many other things, and that particular answer is useful, albeit critically, at an intermediate stage of proving some results in the paper. I personally feel that citing and acknowledging the contribution is respectful enough. However, I want to know what the standard norm is.
I have been in this precise situation. I wrote the manuscript to a reasonably finished state and then contacted the helpful SE person, asking if they want to be a coauthor and whether the attribution is sufficient. The attribution consisted of citing the MO answer and additionally naming them in the acknowledgements.

This approach has the benefit of maintaining or building a good relationship with the helpful person.

Remember that the typical norms of co-authorship include intellectual contribution, as well as writing or critical review of the manuscript, and in any case accepting the final paper. If you see their contribution as relatively minor, you might want to offer them the possibility to extend or otherwise improve the paper if they are interested in co-authorship.

If the contribution does not merit co-authorship, you can still cite it or acknowledge the (possibly anonymous) contributor on SE, if that is warranted. It is polite, but not required, to ask the person how they should be referred to, in any case.