Is the word "literally" used appropriately in the following sentence from XKCD?
I just realized these are literally the same people
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It only takes a minute to sign up.Sign up to join this community
It depends on what you consider appropriate. In the case of the linked comic, it is not a correct use of the word literally, drawing from its definition. On a practical level, the meaning is clear (that the two groups are indistinguishable based on behaviors), and the usage is common (if difficult to defend).
The comic depicts two groups, and to the extent that any of the stick figures have details that allow us to distinguish between them they are clearly different individuals on each side, not the (plausibly) same individuals rallying around different signs. Though, being familiar with other xkcd comics, I would suspect that the author was very deliberate in choosing the caption and would be amused to incite grammar policing of the cartoon.
Is it appropriate? Or is it technically correct according to the dictionary definition of the word "literally"?
It is not technically correct as their are obviously people who care a lot about grammar who do not care about fashion and people who care about fashion who do not care about grammar so they are not literally the same people.
However, it is appropriate because the technical misuse of the word "literally" is part of the joke.
It depends on how literal you want to take literally. The words comes to us from the Latin littera (letter of the alphabet), and it's used to describe exact correspondences, "to the letter" in the idiomatic expression. This is often seen in translations of foreign words. For example from Theory of Language: The Representational Function of Language by Karl Bühler:
Compounds such as 'Fingerhut [thimble, literally "finger-hat"], Handschuh [glove, literally "hand-shoe"], Tischbein [table-leg] are metaphors....
But the word has a hyperbolic use --
I was so embarrassed that I literally wished I was dead.
This is an exaggeration of my feeling of really, really wishing I hadn't been there. In your example, it's an exaggeration of the scope of the correspondence. The statement isn't a true claim as a statement about a census, i.e., we can find people in the fashion police who don't care about grammar and vice versa. But the statement is claimed as true about a consensus, i.e., that the correspondence of attitudes of the two groups is exact.
The exaggerated sense of literally can give it the sense of the word's "literal" opposite, namely figuratively as in
He literally destroyed his opponent in the debate.
This is appropriate on all possible levels.
If you have a look at a dictionary, literally has already lost the pedantic meaning the joke refers to. Just for example, both, MW and ODO already list the meaning everyone complains about and neither of the other answerers has bothered to check.
So apart from the displayed self-righteous grammar police this usage is completely appropriate. Even if it wasn't there is such a thing as artistic license, which employed in a joke makes it appropriate on its own.