"All You Zombies—" by Robert A. Heinlein (1959)

Plot Summary:

       This story is not what is typically expected from works involving immortality, however it is gripping and does not reveal what is truly occurring until the very end of the story. A young man, known as the unmarried mother, is taken back in time and "tricked into impregnating his younger, female self (before he underwent a sex change); he thus turns out to be the offspring of that union, with the paradoxical result that he is his own mother and father. As the story unfolds, all the major characters are revealed to be the same person, at different stages of her/his life"(Wikipedia). 

Type of Immortality:    Solipsistic—the main character realizes he/she is stuck in an endless temporal loop and that he is his own father, mother and baby. 

Source of Immortality:    Time Machine

Consequences:    Loneliness

    It is revealed that the unmarried mother's name is actually Jane, and one of the the last things Jane does in the story is glance at the ring on her/his finger which is of an ouroboros; symbolizing her/his own immortality. In this very strange case, immortality is an endless loop of the main character creating and recreating herself/himself. It results in eternal loneliness for Jane because she is in love with herself, but with a different version of herself that exists in a different time period. This loneliness is captured by the last lines of the story, "You aren't really there at all. There isn't anybody but me—Jane—here alone in the dark. I miss you dreadfully!" The irony comes from the fact that he is missing his own female version and that he misses her dreadfully even though he is always with her; because they are the same person. 
    There are many hints throughout the story about his/her immortality. Beginning with comments from the bartender that reveal he knows a lot more about the unmarried mother than he should. Such as "I didn't like his looks—I never had—but . . . he was my boy", he literally means the unmarried mother is his boy and he is commenting how he never liked his own looks. In addition, the bartender tells the unmarried mother how everyone in his family is a bastard, because they are all born from themselves. Jane's baby was snatched by man "with a face-shaped face, like yours or mine" which is ironic because her baby was snatched by the older version of herself when she was man. Furthermore, the song "I'm My Own Grandpaw" started playing on the jukebox; foreshadowing the fact that the bartender is indeed his own grandfather.