Scientists try to answer this by relying on science. But the scientific method works entirely by using an empirical approach, experiments with physical things. So how can science give us an answer about what happens when you die? It depends on how you think about life and death. If you use the analogy of a dream, then this way of reasoning can be quite compelling.
ANALOGY OF A DREAM
So, there is the idea, that it is just a dream and you might wake up at any time. This is a philosophical view that is impossible to disprove really. It's more compelling if you are someone who has vivid and lucid dreams. A lucid dream is one where you know that you are dreaming and so can look at the dream carefully, knowing that it is a dream.
Richard Feynman, famous Nobel laureate physicist, was able to do this when young - later he decided to stop lucid dreaming. But while he could do it, he investigated his dreams like a scientist.
"...The next time I had a dream, there was a girl lying in tall grass, and she had red hair. I tried to see if I could see each hair. You know how there's a little area of color just where the sun is reflecting--the diffraction effect, I could see that! I could see each hair as sharp as you want: perfect vision!
"Another time I had a dream in which a thumbtack was stuck in a doorframe. I see the tack, run my fingers down the doorframe, and I feel the tack. So the "seeing department" and the "feeling department" of the brain seem to be connected. Then I say to myself, Could it be that they don't have to be connected? I look at the doorframe again, and there's no thumbtack. I run my finger down the doorframe, and I feel the tack!"
(long quote from Feynman on Reddit.com)
And you can experience pain during dreams also. Including pains that you don't have while awake. It's a rare experience, but does happen. Some dreamers can wake from a dream with high levels of pain, and the pain vanishes because it was just a dream pain.
And many people have the experiencing of waking from a dream, only to find that they are still dreaming. Sometimes the experience is so vivid that even when they finally wake properly, after several false awakenings, they may be unsure whether they have woken up properly yet, or are still in a dream. See this web survey of false awakening.
With that background, what if this is a dream? There isn't really too much more to say here, philosophers have argued it for centuries, and nobody has a knock down way to prove that you are not dreaming. You could dream all the science and experiments. They seem coherent - but are they? All you really have is the present moment in a dream - and the rest is your memories which are dream memories if it really is a dream. I don't think there is any way to prove that it isn't. You can do experiments in the realm of mind, where you direct your mind in particular ways and see what happens, as Richard Feynman did. But these are not recognized by science at present. Except in research on dreams, and those only in a limited way.
Scientists often assume that the only way to understand the mind properly is to look at the brain. So, there's a kind of underlying assumption that everything we think and feel can be explained in terms of brain processes. It's important I think to realize, that is just a hypothesis. It is not proven.
ANALOGY OF A COMPUTER
They also often go further and say that the brain is just a computer running a computer program. That again is just a hypothesis. I go into this a fair bit in some of my articles on artificial intelligence: Why Strong Artificial Intelligences Need Protection From Us - Not Us From Them
I don’t think there is any evidence at all yet, that the mind is a computer program, for the reason given there. Some things are analogous, for sure, the computer is a good metaphor for some aspects of how our minds work and computers can do things that we thought of as only the province of humans in the past. E.g. playing chess or go - but they don’t do it in the way humans do. We have a natural tendency to anthropomorphise anything that resembles us, even dolls and action figures. Back in the sixteenth century people were very impressed by clockwork automata, such as Jacques de Vaucanson's seventeenth century flute player. Or this lady playing an organ by Jaquet-Droz from the eighteenth century - the organ isn’t powered like a music box, she actually plays it with her fingers.
Or automata that could imitate human handwriting with a real quill pen:
You could actually program it, in the sense that you gave it a list of letters to write so could change what it wrote to anything you like.
CIMA mg 8332 Automaton in the Swiss Museum CIMA.
Philosophers from that time period used clockwork as analogies for the whole universe, and for actions of humans also. In the Mechanical philosophy of Descartes etc. Descartes wrote, about our perception of light, sounds etc, their imprints on the imagination, their retention in memory, our appetites and passions, and the external movements of our body as a result:
“I wish you to consider all of these as following altogether naturally in this Machine from the disposition of its organs alone, neither more nor less than do the movements of a clock or othe rautomaton from that of its counterweight and wheels…”
This analogy is still in our thinking to some extent, in metaphors such as “you are wound up” using the metaphor of a wound up spring in a clockwork machine. Or “I can see the cogs turning” as a metaphor for slow thought processes. Nowadays we know that the brain doesn’t run like clockwork but there are some close analogies. We also no longer think of it as like a hydraulic machine, another early metaphor. And to some extent yes it is mechanical, many parts of our body, e.g. our skeleton, and our heart pumping the blood, function in mechanical ways. The hydraulic metaphor is valid also, much of the way our body works is hydraulic. Now we have this computer metaphor. But I think so far it is no more than a metaphor and partial explanation still. Indeed - anything a computer can do can be done with clockwork, only more slowly and requiring a much larger machine. So in a way this computer metaphor we use today is just the old clockwork metaphor updated. There is nothing essentially “electronic” about a computer. And of course there is nothing resembling a transistor in the brain - so our brains certainly don’t work like a computer in detail.
Anyway even if there was a way to prove that the mind works like a computer, it still wouldn’t prove that when you die that’s it. If you use the analogy of a dream, that’s like a dream in which you prove to yourself conclusively that you are a program running on a dream computer - and then you wake up. It still won’t get you outside those limitations of science.
ASSUMING THE CONCLUSION
Obviously, if you start with the premiss that everything can be understood only through physical experiments - then the scientific approach can never prove existence of life after death. It is pre-biased to come up with the answer "No". They can only define life and awareness in terms that tie it down intimately to the body, because they don't recognize any other way of investigating this as valid.
About the only place in science where you have any acknowledgement that mind may have a role to play at all is in Quantum Mechanics, where they talk about observers, and the way observation influences what you can see in surprising ways. Observation is so intimately tied up with what you observe, that you can't actually say that an electron, say, has a particular location or velocity unless you observe it first.
What is observation there except activity of the mind? That might suggest perhaps that you can't completely eliminate the mind when you try to understand how the world works.
Still, even knowing that, if you are deeply ingrained in scientific thinking, you may think that there is no other way to think about awareness and consciousness. The whole thing may seem obvious to you, that when your brain dies, then that has to be the end of awareness and life and consciousness.
SCIENCE CAN’T PROVE THE VALIDITY OF THE SCIENTIFIC METHOD
But - science is itself not able to prove that science works. You can't prove scientifically that if you let go of a ball, it will fall to the ground. In a dream, you may be able to fly just by willing to fly. You may be able to throw a ball into the air and hit the Moon with it. Why can't we do things like that in real life? Science can't answer questions like that. Only philosophy can address that, or religion, or - has to be something outside of science itself, to try to understand why science works.
Some scientists are so out of touch with philosophy, that they can't understand how there can be any such subject, except as a science of how the mind works and the thoughts that people have. But their very science itself depends on a number of deeply held assumptions. To examine those, and understand why they work, and how they work,requires philosophy.
LIMITATIONS OF SCIENCE
Similarly science can't explain why there is anything at all. Even those who try to explain our universe using the idea that somehow it appeared as a quantum fluctuation out of nothing (Stephen Hawking’s idea) - that's just one theory, not proved, and many dispute it, with many other theories. But in any case, it just pushes the problem back. It doesn't explain why there is such a possibility as a quantum fluctuation, or what kind of a nothing could have a universe suddenly appear out of it. Fundamentally, it still can't explain why there is anything here right now.
Nor does science have any answers to why we suffer. It can help greatly with sickness, suffering, ill health, good food etc. Education. But in many cases you may be in pain and science can't do anything to help. Even when you enjoy life to the full, you know that there is no way that scientific research will let you continue like that for ever.
So, science has limitations. Some people think that there are simply no answers to any of those things. Some think there are answers of one kind or another. But there isn't any scientific experiment you can do, at present anyway, to decide if they have answers or not.
CONTINUATION AFTER YOU DIE
So back to the idea of an afterlife. I'm taking that in the very general sense - the idea that there is some continuation after you die. For me, I think that this continuation may be in the form of future lives as a human, animal, insect, or types of beings that we don't know exist yet. I believe, for various reasons, that I've had many previous lives and forgotten them all. I don't claim to have any proof of this at all; it just the idea that makes most sense to me :).
Others have other ideas. Ancestor worship, Hindu ideas of a soul, again with many rebirths, Theosophical ideas, Christian ideas of a heaven and hell, Ideas of pure lands etc. I don't think there is any way to decide between those possibilities, and many others. But I think that the belief that when this life ends "that's it" is as much of a faith or belief as any of those and as little supported as them.
If you are already convinced that we can't learn anything except through experiment, then this argument won't persuade you. You have closed your mind to any other possibility. But if you think there is a possibility of things you might be able to understand directly through the mind - that opens the possibility that all of this, this world, my body, external world, this computer I'm using etc etc - is in some ways a construct of mind.
It’s like a dream. With other beings in the dream also. Experiments do work, it seems. So there must be a lot of coherence to it, and maybe in some sense there is a reality to it. Far more coherent than any dream. But still - there is no way you can actually prove conclusively that you are not dreaming right now. So on that basis, all this experimental data about brains and so on - that's like dream experiments. In a dream you might prove many things, but when you wake up - all of that complicated dream is gone and you are on to your real life or your next dream.
IF AWARENESS ENDS AT DEATH, HOW CAN THIS BE HAPPENING NOW?
Then another thing that might shake your confidence that when we die, that's it - what happens after you die? That's the end of your awareness. So - at that point, there is no you left to have lived previously. So how can your life have actually happened at all? How can now be happening, if in the future, there will be nobody left to have had this experience?
This argument simply won't work at all if you are deeply ingrained with scientific ways of thinking. But for others, it might give pause for thought. I know some of you will read this and just say "nonsense, this chap is daft and he may be a nice enough chap in other ways but he has gone off his rocker here, he is not capable of critical thought".
But others, maybe you will find a few ideas here to get you thinking about it? There are many scientists who are Christian, Muslim, Jews, Buddhist, Hindu, Shinto, Taoist, etc. They don't find it at all incompatible with their beliefs, to be scientists. They know that they haven't empirically proved their beliefs scientifically. But they also consider science to be limited in the domain of what it can and can't prove. And give themselves permission to go beyond the realm of science, and to consider philosophy, and religious ideas.
So, I’m saying, you don’t have to believe in miracles to be a scientist like that. Just to recognize limitations of the scientific method. Just to be open to that possibility, that there might be something else after you die - I think that is by far the most scientific approach also. Because it's unscientific to assume anything without proof. To say that “when you die, that's it”, is as strong a statement as to say that when you die you will definitely take rebirth or end up in some particular afterlife or whatever ones belief may be.
There are a few scientists who are out certain that when you die that's it, like Richard Dworkin. Many more are just not sure what happens and open to various possibilities.
For religious people, I think it helps to acknowledge that you can't prove anything in this topic area. That can actually help your faith be stronger - because by looking carefully at this, acknowledging that you don't know, then you can see more clearly what it is you do believe, and why you do. But at the same time recognizing that others of other faiths believe other things about what happens when you die. And that there is no way to decide between any of those on scientific grounds.
In this way I think we can have greater tolerance of different religions for each other and for those who think that this life is all that there is. The idea that this life is all there is, amongst some scientists, has become as strong and irrational a faith as a religion. They simply can't see any possibility that there might be other ways of looking at things. Basically these scientists have a belief system in which the scientific method can settle all questions. That is as much a matter of faith as any religion that has been preached by some great teacher in the past.
It can't be proved, and the arguments they produce in support of it are no more valid than the many proofs of existence of God, or the arguments about numbers of angels dancing on a pin. They seem valid only because you have subscribed to this view that science will explain everything, so deeply, you can't even see that you have subscribed to it. That's as dogmatic a point of view as the most extreme kind of religious fanaticism, seems to me, as someone who has a strong background in science, maths and philosophy.
IS THERE SUCH A SUBJECT AS PHILOSOPHY?
Some scientists think there is simply no way to investigate things except by the scientific method. That rules out the entire realm of philosophy. There is no way to study philosophy using the methods of science. You can't do experiments to decide questions in philosophy, by the very nature of the subject.
If you think you can settle questions in philosophy with scientific experiments, that suggests you have never had any philosophical questions or thoughts - quite rare but true of some scientists indeed. Or maybe you used to think about philosophy as a child - I mean the ordinary natural philosophy everyone does or most people do rather than the academic subject - and have since forgotten that you did it.
So with this background, how could science ever say anything definitive about what happens when you die? Maybe it can but if so I think in some future where science is extended to include some aspect of understanding mind, sort of meld of science, philosophy and maybe some kind of mind experiments? At any rate we don't have that yet. As a scientist, therefore, I think there is no need at all to ascribe to miracles to have a wide variety of views about what happens when you die. And the view that "When you die that's it" is as much a belief system as any religion, I think.
See also my youtube video:
This is my answer to Is there life after death? - I’m not sure if the two questions should be merged.