Where on earth did this idea of a soul come from?
One thing we can be sure about is that it's a very old idea. In fact it was probably the reason for religions in the first place as there is archaeological evidence of burials from the the Palaeolithic and burial is generally taken as evidence of some sort of religion and ideas of an afterlife (which implies belief in a soul). There is even some evidence that Neanderthals may have had ritual burials. There is actual textual evidence of belief in a soul from the Bronze Age in the form of biblical writings, Sanskrit Vedas and Egyptian hieroglyphs.
So why is this notion that there is a separate entity inhabiting our bodies and which somehow continues to exist after death, such a strong and persistent belief in all human societies?
The answer is to be found in the way our brains work and how we perceive the world around us. Essentially, we model the world around us and then manipulate that model to make reasonable short-term predictions about how our actions will affect that world and how we need to interact with it to achieve a desired outcome. When it comes to human interactions we call this ability to include other people in our conceptual model and to make reasonably good estimates of how our actions will affect them, empathy.
In order to complete this model of course, we need to include ourselves in it but also to remain separate from our model so we can observe it, so we include what seems intuitive - a person living inside our bodies and observing the world through the 'windows' of our eyes. Of course, this is nothing more than a reification of our conscious self-awareness.
This reification also serves another purpose: it serves as the 'person' we talk to when we are thinking, or even as the 'person' who is doing the thinking and 'telling' us its thoughts. It somehow feels like another entity communicating with us silently but often in words.
And lastly, if fills another need. We find the idea of oblivion very difficult to comprehend. This is not necessarily through innate fear of death and the need for self-preservation, but the actual idea of not existing; of not thinking ever again; of not knowing what happens next; and of everything carrying on without us. This is actually very difficult to comprehend. You can come close to it if you have ever had a general anaesthetic when the shutters go up and you have no memory until you begin to come round. Only with death you don't begin to come round of course. It is very difficult to imagine nothingness; of the world carrying on without you.
And yet you know it carried on before you were born.
The notion of a soul helps us rationalise the seemingly irrational idea of not existing.
And yet there is not as single scrap of evidence to suggest there is something other than physiology going on in a living body or that anything other than the anatomy remains when the physiology stops. Nothing leaves our bodies when we die any more so than something leaves a candle when it's flame goes out. We go nowhere when we die because there is nowhere to go and nothing to go there.
The soul is simply the result of our adequate but ultimately faulty intuitive model of the world as we see and experience it, and of our human psychology and intelligence. It's a figment of our imagination, as is the world we invented for it to go to.
But our component atoms and molecules return from whence they came: to the earth from which we borrowed them, maybe into the bodies of future generations of living things and ultimately back into the cosmos and into the suns of the future to be recycled as new planets and maybe even as new living things on other planets, or maybe just to stay in space as the remains of exploding suns of the future until the end of the universe.
Scatter my dust and ashes, feed me to the wind
So that I may be part of all you see, the air you are breathing
I'll be part of the curlew's cry and the soaring hawk
The blue milkwort and the sundew hung with diamonds
I'll be riding the gentle wind that blows through your hair
Reminding you how we shared in the joy of living.
Ewan MacColl, The Joy Of Living