Every man, woman, and child is driven in myriad and sometimes inscrutable machinations of their own self-interest. A noble human being is constrained to his nobility by his own devotion, which he would not betray lest he lose his invaluable honor. A religious person is driven to serve their deity either by such lofty motivation as the nobleman or by more base desires for immortality and reward. A good samaritan helps the beleagured man because his conscience demands it; his good sleep demands it. I say this not to deprecate or devalue the actions of human beings, but only to establish that the human mind is irrevocably centered upon the only thing it can ever truly know: the ego. Motivations seem to be undeniably selfish, but are they? It would seem that certain actions can be carried out which would utterly ruin the benefactor, such as self-sacrifice unto death itself.
For the sake of this question, let us assume that death is indeed the end of life, so that we might avoid for a moment the unending squawking of theistic foolishness. After such assumption, let us imagine that one human being dives in front of a bullet for a person he has never met, sacrificing his life for the sake of a total stranger. Surely this is a selfless deed, is it not? The dead man will recieve no compensation; he will not receive so much as gratitude from the man who lives due to his heroism. It seems that the self-sacrificing man in the scenario not only disproves the idea that all actions ultimately feed the ego, but also shows that human beings are capable of acting against their own instinct toward the preservation of self.
And yet, such an answer seems unsatisfactory, if only because of my own vanity and arrogance regarding my ideas. Could it be that there is some sort of selfishness in such a selfless move? I say that there is; the man was no more altruistic (in motivation) than anyone else. If we could peer into the mind of this hero, might we discover that he understood the inevitability of his own demise, whether it be seconds or decades away?
I say that all who sacrifice themselves do so for the same reasons that guide other human decisions. They sacrifice themselves that they might transcend their mortality either by their legacy as heroes or by reward in a world after. The hero claims immortality for himself after the fashion of Achilles, though rarely in such magnitude. The more heroic his dangerous and potentially self-destructive deeds, the greater his legacy, the greater his legend, and the more long-lasting his immortality. It must be agreed that death in the service of some perceived "good" or "just cause" is far more attractive than a death stained with ignominy. In losing themselves they are able defeat the encroaching rot of the conqueror worm, which otherwise would not be denied.
The rational know that their days are numbered. For such men who are able to recognize cold truth and who are inclined in the direction of the heroic, it is not such a difficult choice to sacrifice oneself for another, since death approaches regardless of the movements made by men. Rather than wait for it, a hero meets it head on, and wins a small measure of infinity for himself.