Young seekers of truth go through a phase of wondering whether life has any discernible meaning. Why are we here? Why does the universe exist? Is there a purpose to it all? This is the ultimate question, overarching all others.
The seekers usually plunge into philosophy, and spend years sweating over "being" and "essence" - and quibbling over how the mind obtains knowledge - and how we determine reality - and how language shapes our comprehension. In the end, most of them emerge (as I did) with no better answer than when they began - and a feeling that they wasted a lot of time and effort. Omar Khayyam felt the same way 900 years ago:
Myself when young did eagerly frequent
Doctor and saint, and heard great argument
About it and about, but evermore
Came out by the same door as in I went.
However, despite this futility, I think intelligent people can address the meaning-of-life question sensibly, without bogging down in philosophical stewing and hair-splitting. That's what I'd like to do now: just spell out what's knowable, as I see it. The following is my personal, amateur view.
First, 90 percent of humanity - the religious believers - needn't ask the meaning of life. Churches, mosques and temples tell them the answer. Priests and scriptures say a magical, invisible god created the universe, and put people here to be tested - and set behavior rules for us to follow - and created a heaven to reward the rule-followers after they die - and a hell to torture the rule-breakers - etc. This supernatural explanation, or some other mystical version, is accepted by the vast preponderance of the species.
But some of us can't swallow it, because there's no evidence. Nobody can prove that people live after death. Nobody can prove that we are tortured or rewarded in an afterlife - or that there are invisible spirits to do the torturing and rewarding.
Therefore, we unsure people are doomed to be seekers, always searching for a meaning to life, but never quite finding one. I've been going through it for half a century. Now, I think I can declare that there are two clear answers: (1) Life has no meaning. (2) Life has a thousand meanings.
First, the lack of meaning: As for an ultimate purpose or transcending moral order, all the great thinkers since ancient Greece have failed to find one. The best philosophical minds have dug into this for 25 centuries, without success. There have been endless theories, but no clear answer.
Martin Heidegger concluded that we are doomed to live our whole lives and die without knowing why we're here. That's existentialism: All we can really know is that we and the material world exist.
(Actually, I can know only one thing with absolute certainty: that my mind exists, and is receiving impressions. Hypothetically, the images, sounds, feelings, etc., in my consciousness could be illusions - perhaps like artificial inputs to a brain in a laboratory tank - and the entire objective world could be fictitious. But there's no question whatsoever that my mind is receiving them. Rene Descartes stated this truth as "cogito, ergo sum" - I think, therefore I am. However, although we can't be totally sure of the validity of the sense impressions reaching our minds, we all presume that external people, places and things actually exist. Their existence seems verified by thousands - millions - of encounters in our activities. We base our whole lives, and our search for knowledge, on this presumption that they are real.)
As we learn scientific facts, we realize that the universe is horribly violent, with stars exploding or disappearing into black holes. Here on Earth, nature can be equally monstrous. Both the cosmos and our biosphere seem utterly indifferent to humanity, caring not a whit whether we live or die. Earthquakes and hurricanes and volcanoes, etc., don't give a damn whether they hit us or miss us. Tigers, tapeworms and bacteria consider us food.