Drifting through wikipedia...
John Locke's chapter 27 "On Identity and Diversity" in An Essay Concerning Human Understanding (1689) has been said to be one of the first modern conceptualizations of consciousness as the repeated self-identification of oneself, through which moral responsibility could be attributed to the subject - and therefore punishment and guiltiness justified, as critics such as Nietzsche would point out.
According to Locke, personal identity (the self) "depends on consciousness, not on substance" nor on the soul. We are the same person to the extent that we are conscious of our past and future thoughts and actions in the same way as we are conscious of our present thoughts and actions. If consciousness is this "thought" which doubles all thoughts, then personal identity is only founded on the repeated act of consciousness: "This may show us wherein personal identity consists: not in the identity of substance, but... in the identity of consciousness".
Locke argues that you may be judged only by the acts of your body, as this is what is apparent to all but God; however, you are in truth only responsible for the acts of which you are conscious. This forms the basis of the insanity defense: one can't be held accountable for acts performed while one was unconscious - and therefore leads to interesting philosophical questions:
"personal identity consists [not in the identity of substance] but in the identity of consciousness, wherein if Socrates and the present mayor of Queensborough agree, they are the same person: if the same Socrates waking and sleeping do not partake of the same consciousness, Socrates waking and sleeping is not the same person. And to punish Socrates waking for what sleeping Socrates thought, and waking Socrates was never conscious of, would be no more right, than to punish one twin for what his brother-twin did, whereof he knew nothing, because their outsides were so like, that they could not be distinguished; for such twins have been seen."
Locke's conception of personal identity is founded, not on the substance or the body, but in the "same continued consciousness", which is also distinct from the soul, since the soul may have no consciousness of itself (as in reincarnation). He creates a third distinction between the soul and the body - for the brain, like the body and like any substance, may change, while consciousness remains the same. Therefore, according to Locke, personal identity resides not in the brain, but in consciousness.
The problem of personal identity is at the center of discussions about life after death, and immortality. In order to exist after death, there has to be a person after death who is the same person as the person who died. So, in what way is the post-death individual the same person as the earlier living person?