On a whim, I just read Edgar Allan Poe's 1845 short story,
The Imp of the Perverse.
I'd been familiar with this turn of phrase—denoting the urge that we've all felt at one time or another to do something detrimental to us, for seemingly no good reason except that we know it will harm us—for some time, but had never actually sat down and read the short story where it had originated. Having a few free minutes, I set about doing so; would that I had at the expense of some other activity that absolutely needed to be done, so that I could have availed myself of the irony of reading about this quirk while simultaneously indulging in it!
Alas, I was responsible in partaking of this leisure activity, and so can claim no such drollery.
As it is, I was a bit surprised by how much Poe references (what we now know to be a quack science) of phrenology. In this case, I strongly suspect that this is because this is the most reputable (and quite possibly only) behavioral science of the day. Certainly, given that the initial part of the story (which is an essay, presented by the narrator as his attempt to define what the imp of the perverse is before getting to how it has led to his imminent demise) tries to make sense of what's otherwise a senseless impulse, framing it in the context of how the best understanding of his day is silent on the topic seems to put phrenology forward only as the authority in question rather than relying on its specifics.
Of course, as with so much of Poe, there's a theory (mentioned on the Wikipedia page) that he was writing largely about his own issues, in that he often seemed to fall prey to such an imp. Which, I should note, is strictly presented in metaphor; there's no presentation here whatsoever of any sort of mysterious or supernatural force at work; those expecting the narrator to speak about being tormented by some sort of ominous figure will be disappointed, as nothing here says "nevermore."
That said, this is definitely worth a read, being quite short and yet very evocative, as is so often the case with Poe.