What is rebirth?
When most people think of rebirth, they think the permanent consciousness that has existed from childhood will continue into another life. They think consciousness is self. However, the Buddha taught that consciousness is impermanent, constantly changing and is dependently originated.
This is found in MN 38:
Then he went to the Blessed One and, on arrival, having bowed down to
him, sat to one side. As he was sitting there, the Blessed One said to
him, "Is it true, Sāti, that this pernicious view has arisen in you —
'As I understand the Dhamma taught by the Blessed One, it is just this
consciousness that runs and wanders on, not another'?"
"Exactly so, lord. As I understand the Dhamma taught by the Blessed
One, it is just this consciousness that runs and wanders on, not
"Which consciousness, Sāti, is that?"
"This speaker, this knower, lord, that is sensitive here & there to
the ripening of good & evil actions."
"And to whom, worthless man, do you understand me to have taught the
Dhamma like that? Haven't I, in many ways, said of dependently
co-arisen consciousness, 'Apart from a requisite condition, there is
no coming-into-play of consciousness'? But you, through your own poor
grasp, not only slander us but also dig yourself up [by the root] and
produce much demerit for yourself. That will lead to your long-term
harm & suffering."
The rest of the sutta explains the dependent arising of consciousness and other things.
(Re)birth of what?
So, the Buddha did indeed teach that it is the mental idea of the self that is (re)born, and not any specific individual identity.
It is individuality that is (re)born, not the individual. Please also see this answer.
This is also in line with the teaching of sabbe dhamma anatta - all phenomena is not self.
From SN 12.20:
“When, bhikkhus, a noble disciple has clearly seen with correct wisdom
as it really is this dependent origination and these dependently
arisen phenomena, it is impossible that he will run back into the
past, thinking: ‘Did I exist in the past? Did I not exist in the past?
What was I in the past? How was I in the past? Having been what, what
did I become in the past?’ Or that he will run forward into the
future, thinking: ‘Will I exist in the future? Will I not exist in the
future? What will I be in the future? How will I be in the future?
Having been what, what will I become in the future?’ Or that he will
now be inwardly confused about the present thus: ‘Do I exist? Do I not
exist? What am I? How am I? This being—where has it come from, and
where will it go?’
Eternalism and annihilationism
In other suttas, we see that the belief in a specific self identity as having existed in the past and will exist in the future, is the view of eternalism.
On the other hand, thinking that there is no self at all (AN 6.38), or that a specific self identity will be destroyed in the future at death or some other point in time, is the view of annihilationism.
The Buddha taught the middle (SN 12.17), which is dependent origination.
If you step into a flowing river then step out then later step in again, would you be stepping into the same river twice? It may appear so, but in reality, the molecules, flow speed, temperature, pressure etc. of the river would have changed. So, it's not the exact same river.
Similarly, the mental idea of the self keeps changing throughout one's life, and even throughout a single day. Also consciousness, the mind, the body, is also changing. The mind changes more rapidly than the body (SN 12.61).
Let's say a certain individual named George exists with his own personality, likes and dislikes, opinions etc. One day his brain becomes damaged or perhaps deteriorated due to Alzheimer's disease. So, has the individual George who has existed before, now become destroyed? No. It's just that the dependently originated self has now changed.
Delineating the birth, continuity and death of a certain individual named George, is in fact the view of eternalism and annihilationism. In reality, what or who George is, has changed throughout his life. When he damaged his brain, has he disappeared? When he died, has he disappeared? Well, there was no single permanent entity called George that had existed. He always changed, just like the river.
The ever-changing dependently originated identity of George is like a kind of rebirth of the mental idea of self and the rebirth of individuality, that occurs from moment to moment as long as the mind-body phenomena operates.
Some even say that heaven, hell, animal births etc. are all allegorical and representative of different mental states.
Buddhism and neuroscience
I would in fact argue that Buddhism is very close to modern neuroscience.
The idea here is that there is the mind and there is the body. Both are separate from each other, yet are mutually dependent on one another.
If you drink alcohol, the body affects the mind. If you are depressed and this triggers diseases, the mind affects the body. They are mutually dependent.
The mind is not in the body. It's like software or information. The body is like hardware. Just like how you can transfer a message from one phone to another, the mind can send ideas to others.
The individual or specific self identity is also just a mental idea. It is ever-changing and is dependently originated based on conditions. It arises from the mind-body phenomena.
The idea that a specific individual must behave well, so that he will be reborn in good lives in future, is a teaching for beginners in Buddhism. The goal is to reduce or eliminate suffering in the distant future.
For advanced students of Buddhism, the teaching is "all phenomena is not self" (sabbe dhamma anatta). The goal is to reduce or eliminate suffering in the here-and-now.