The Prince and the Cobbler
Locke's account of personal identity distinguishes between what it means to be a man (i.e., human) and what it means to be a person. He begins by pointing out that our conception of a single man at different times (as opposed to different men at different times) is inextricably tied to that man's body. That is, for a man to be the same man over time it is necessary that that man's body persist over that time. On the other hand, our conception of a person involves perception and consciousness. One cannot be the same person without some connection between current consciousness and past consciousness.
But this presents a problem for Locke's account. While it would be uncontroversial that a single continuous, uninterrupted flow of conscious thought would constitute the same person, there are no such flows. We have periods of forgetfulness and unconsciousness, and we never have all of our past thoughts and perceptions before our mind at once. Thus, continuity is tenuous, and were personal identity to require continuity, it would also be tenuous. Instead of continuity, then, Locke posits that it is just the same consciousness at different times that constitutes personal identity. Perhaps most interesting is Locke's contention that two different bodies might possess the same consciousness (or one consciousness might appear in one body for awhile and then in another). Thus, were the soul (and consciousness) of a prince to show up in the body of a cobbler, Locke would claim that the man remains the cobbler, but the person would be the prince.
While the example of the prince and the cobbler seems fanciful, consider Locke's application of his distinction. Because a single human might have vast gaps in her consciousness, with little or no persistence of memories overtime, she might in fact embody several different persons. This in turn makes sense of our intuitions about how we ought to treat insane people or people who are "out of their minds.” That is, our beliefs that it is wrong to punish a man for wrongdoing that occurred when his consciousness was far removed from the present comport with Locke's view of identity.