It's more than an interesting philosophical question as it turns out. A new paper looking at Alzheimer’s and other neurodegenerative diseases suggests that it's not in our intellect or memory but in our moral character (WSJ):
The researchers found that the people who cared for the FTD patients were much more likely to feel that they had become different people than the caregivers of the Alzheimer’s patients. The ALS caregivers were least likely to feel that the patient had become a different person. What’s more, a sophisticated statistical analysis showed that this was the effect of changes in the patient’s moral behavior in particular. Across all three groups, changes in moral behavior predicted changes in perceived identity, while changes in memory or intellect did not.
These results suggest something profound. Our moral character, after all, is what links us to other people. It’s the part of us that goes beyond our own tangle of neurons to touch the brains and lives of others. Because that moral character is central to who we are, there is a sense in which Edith literally, and not just metaphorically, lives on in the people who loved her.