Always remember: asking for legal advice on the Internet in itself is already a very doubtful approach. What if I told you "hey, you are fine, just go for it". And you go for it, and then you get sued. Do you think you can tell the judge "but sir, some grey cat on the interwebs told me, I would be fine"?! You think that would work? Or maybe the judge will reply: "I guess that cat meant you will be fined?"
If you are serious about such inquiries: consider talking to a real professional, and be ready to have plenty of relevant details ready for consumption. And to pay for it.
But having said that, in this case, there two things to consider:
- the basic "ideas" that frame this community
- the look and feel, and the implementation that drives it
For the first one, I think there would need to be patents of some form in order to sue you for "infringement". I am not aware of any such patents.
I also think that any such thing might be easily challenged, simply given the fact that you probably find "prior art" for almost any concept that this community is using. Not in one place, but I am sure: most ideas we have here were used here or there before. Just not together.
For the second aspect, that leads to a big legal depends. Meaning: if you happen to implement your own community that looks "almost" like Stack Overflow, or Stack Exchange, some clever attorneys might find "good enough" reasons to drag you to court. And what happens there, who knows.
Meaning: if you create your own community, that works on similar principles, but that can't be mistaken to be a product of SE Inc., then the grey cat form the interwebs believes that you should be fine.