When a student of the Buddha asked him this question, the Buddha simply said “not a valid question!”
It can be somewhat puzzling, but the reasons will be better understood if we re-examine a few common misconceptions around this:
Misconception 1 Rebirth occurs due to a self moving from one body to another: This is inconsistent with the core teaching of the Buddha, because if this were true, then the only way to attain nibbāṇa (end of rebirth) would be to annihilate oneself! Then what is the point of nibbāṇa?
Now in Hinduism, the Bhagavadgita, makes this claim, but also claims that the self is eternal and not destroyable. Liberation is said to consist of realizing the relationship between the self and the “super-self”. Different branches of Vedanta interpret this relationship differently. But if this were true, then there is no way to end rebirth at all, because the eternal self is still around! What is to prevent this eternal self from being reborn again?
Instead, according to the Buddha, rebirth is a phenomenon that is fueled by another process called bhava, becoming, which in turn is fueled by craving and clinging. For most of us, rebirth is about some thing behind the process, but the Buddha saw this purely in phenomenological terms. So in other words, rebirth happens as a result of us creating a thought-world motivated by our craving. If craving were not present, rebirth cannot occur. This is just like the relationship between fire and its fuel, which is exactly the imagery the Buddha uses.
This is precisely why nibbāṇa can even be achieved: because it is possible to put an end to craving, without annihilating oneself.
Misconception 2 Self is a thing, that either exists or does not: Actually, it is better called ‘self-ing’ (if such a verb could be coined), in the sense of an activity. We are constantly creating this sense of self through our actions. So it is not so much that our self exists, and our self acts, but that our actions “create” our selves through our actions. And this process is called papañca.
In reality, this activity of ‘self-ing’ is happening all the time. So it seems like there is always a self around here. But actually, we are generating the notion of self around some activity. It is not bad to identify with something. One of the misconceptions is that if we put an end to all identification, that would be nibbāṇa. But that is hardly the case. If it were true, we could simply commit suicide instead.
In reality the path begins with strong identification with people of integrity and disidentification with misguided people. One has to have strong ideas of a “good life” and identify oneself as living such a life. But at the same time, one can’t just identify oneself as a “good” person when one is committing murder, or stealing food. Our identities are also shaped by our actions and the thought-worlds created by them.
Misconception 3 Anatta means “no self”: By far, this is the most common misconception about Buddhism, and it is quite unfortunately perpetuated by the works of the prominent 20th century Buddhist Walpola Rahula. As a doctrine, the Buddha could not have taught something as ludicrous as “no self”. The perception of self as an agent of actions is crucial to the central tenet of kamma. For example, I can only pee for myself!
The primordial question that underlies the spiritual quest is “What when I do it, would lead to my long term well-being?”, which contains two explicit words showing the perception of self. In fact when a brahman approached him and said that he held the view that “there is no self-doer, and no other-doer”, the Buddha styled that as a completely ludicrous position, completely unheard of!
So the Buddha couldn’t have taught that there is no self. Instead, the Buddha taught that both the perception of “self” and the perception of “not self” are strategies for happiness that we ought to use skillfully. We should use the perception of self with regard to things that will give us long-term happiness, while developing perception of anatta or “not self” for things that produce only short-term happiness, and therefore unworthy of identifying with.
Notice that I talk of the “perception of self” or the “perception of not self”. I don’t talk of it as if it were a regular “characterisitic”. In fact the term “three characteristics” (tilakkhaṇa) appears only in the Abhidhamma commentaries. The Sutta Pitaka itself treats anatta as a perception - saññā. So the Buddha talked of anatta as a strategy of perceiving experience, not as a metaphysical reality.
As an example, when we are generous, we have a perception of self (or identity) as the giver, which gives us a feeling of being spiritually wealthy. At the same time, we develop the perception of “not self” with regard to the object given away - now it belongs to someone else. When we associate with wise people, we are consciously making a choice of the identity we want to have around us. Associating with the wise brings about a particular perception of self that is required as a stepping stone to enter the path.
Misconception 4 The five aggregates are the self: Another misconception coming from literature that claims that the Buddha taught that there is no self. In fact these are precisely what the Buddha said is not your self! A major misconception around the five aggregates is that the aggregates are things. So we look for the aggregates as objects or materials. But the Buddha used the phrase “five clinging aggregates” (pancupādānakkhandhā). He treated them as activities of the mind, not as materials.
For example when the Buddha says that the body is an aggregate, he is talking of our experience of the body, and what we fabricate around it. He is not talking of the material body alone. In fact, with regard to the material body, he teaches us to develop a sense of equanimity, through body contemplation, composed of various disgusting parts. So materials (rūpa) are only worth of equanimity - not worth considering as self. Here again there is the perception of not self with regard to the material body.
Again, our feelings (vedanā) towards ourselves and other beings can play a major role in the development of the sublime attitudes - the brahmavihāras. In this we again use our perception of self and other.
Now when we think of our body, we don’t just think of it as materials, but more in terms of what we can do with it. The problem with the five aggregates is precisely that we have a modicum of control over them and our mind takes that on face value and assumes it to be the self. So the Buddha has us examine the body (rūpa) and see to what extent the body and what we can do with this body can be deemed a self. He called the things we do with the body, or activities we do to experience the body as sañkhāra - fabrication.
Even the perception of self, and the perception of not-self are sañkhāras. The entire noble eightfold path is a sañkhāra, a very specialized one at that. But it leads beyond all sañkhāras. At that point all questions of self, not self, or other melt away.