I never show online, ever.
Live is a different story, though. Given I am a social creature when I'm playing brick & mortar, I will show if I gain something from it. Let me explain ...
I may (rarely) show a bluff to induce tilt in another player. This is not always a good idea, given you paint a rather large target on your head. I am far more likely to show an opponent who I am sitting in close proximity to that they have made a good fold, particularly one who I have targeted and wish them to continue folding to me. I want them to feel good about their decision.
Also, since poker is a game of information, I never give more information than I am likely to receive. I find that in this social setting, if I show one good hand where I beat them (nuts or damn close, so I know they didn't fold the winner), this favor is returned in kind, and generally more than once. My showing a winning hand (while not often) has to be of some benefit to me. 1 show results in me being shown (on average) 3 or more hands from opponents.
Another good time to show is if you've been table-captaining and opening a lot. Say that I have raised 3 of the last 4 hands, raise again, and get folds around. I show the AA, make some comment about how good I'm running, and continue with my pattern. You've put that image in their mind and really haven't given away information other than you raise AA ... they don't need to know you raise 76s or KQo in the exact same way.