Obviously, you're not allowed to use trademarked characters like Superman or Batman in your published works. If I wrote a novel about Superman fighting Lex Luthor, I could get sued.
But what about referencing those characters in a real-world context? If I wrote a book about a child fighting to survive cancer and his family using Superman as a central role model to motivate him, would that similarly break the trademark? What about a book that has nothing to do with Superman or Batman, but which features a scene where two friends casually discuss which superhero would win in a fight?
Is there a distinction between "using" a trademarked character and "referencing" that same character? If so, what is the dividing line?
UPDATE: Thanks to a very helpful comment, I've edited my post to change "copyright" to "trademark." I'd still love for someone to help me navigate the possible repercussions, though!