Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
First of all, make sure that the puzzle is not copyrighted.
If the puzzle is in the public domain, then it is required to note that it is not your puzzle you are posting.
If the puzzle is licenced under a permissive license allowing sharing of the content, then make sure that you give proper attribution and follow their license requirements.
If there is no licence stated, or it is explicitly stated that the puzzle is copyrighted, then you should not post it here. In particular, most puzzle books state that the content is copyrighted.
$\begingroup$If a friend tells me a puzzle and I don't know where he got it or if it's copyrighted I can't ask here? What if I couldn't figure it out, that's the spirit of the Q&A format. It's like taking copywrited code you need help understanding and posting it to SO for explanation.$\endgroup$
$\begingroup$As long as you're not claiming ownership and aren't just copy-pasting from other puzzle sites then I see no issue, IMO. "No license stated" part should be removed.$\endgroup$