It seems that we accept that we have a self-identity (i.e., we are self-conscious) if (a) We discern (usually through introspection) long term consistent intentional (i.e., willed) patterns ("memory") in our manipulation ("relating to") of our environment and (b) Others accept that we have a self-identity (Herbert Mead, Feuerbach).
Dan (probably) has the same hardware as we do (a brain). He communicates his (humanly recognizable and comprehensible) inner world to us (which is how he manipulates us and his environment). Thus, Dan clearly has a self-identity. But he is inconsistent. His intentional (willed) patterns, his memory, are incompatible with those demonstrated by Dan before the accident. Though he clearly is possessed of a self-identity, we cannot say that he has the SAME self-identity he possessed before the crash. In other words, we cannot say that he, indeed, is Dan.
Dan himself does not feel that he has a self-identity at all. He discerns intentional (willed) patterns in his manipulation of his environment but, due to his amnesia, he cannot tell if these are consistent, or long term. In other words, Dan has no memory. Moreover, others do not accept him as Dan (or have their doubts) because they have no memory of Dan as he is now.
Interim conclusion:
Having a memory is a necessary and sufficient condition for possessing a self-identity.
III. Repression
Yet, resorting to memory to define identity may appear to be a circular (even tautological) argument. When we postulate memory - don't we already presuppose the existence of a "remembering agent" with an established self-identity?
Moreover, we keep talking about "discerning", "intentional", or "willed" patterns. But isn't a big part of our self (in the form of the unconscious, full of repressed memories) unavailable to us? Don't we develop defence mechanisms against repressed memories and fantasies, against unconscious content incongruent with our self-image? Even worse, this hidden, inaccessible, dynamically active part of our self is thought responsible for our recurrent discernible patterns of behaviour. The phenomenon of posthypnotic suggestion seems to indicate that this may be the case. The existence of a self-identity is, therefore, determined through introspection (by oneself) and observation (by others) of merely the conscious part of the self.
But the unconscious is as much a part of one's self-identity as one's conscious. What if, due to a mishap, the roles were reversed? What if Dan's conscious part were to become his unconscious and his unconscious part - his conscious? What if all his conscious memories, drives, fears, wishes, fantasies, and hopes - were to become unconscious while his repressed memories, drives, etc. - were to become conscious? Would we still say that it is "the same" Dan and that he retains his self-identity? Not very likely. And yet, one's (unremembered) unconscious - for instance, the conflict between id and ego - determines one's personality and self-identity.
The main contribution of psychoanalysis and later psychodynamic schools is the understanding that self-identity is a dynamic, evolving, ever-changing construct - and not a static, inertial, and passive entity. It casts doubt over the meaningfulness of the question with which we ended the exposition: "Who, exactly, then, is Dan?" Dan is different at different stages of his life (Erikson) and he constantly evolves in accordance with his innate nature (Jung), past history (Adler), drives (Freud), cultural milieu (Horney), upbringing (Klein, Winnicott), needs (Murray), or the interplay with his genetic makeup. Dan is not a thing - he is a process. Even Dan's personality traits and cognitive style, which may well be stable, are often influenced by Dan's social setting and by his social interactions.