What is the meaning of life? The question has been asked and searched for by man since as far back as anyone can remember.
It is not an unanswerable question. As a matter of fact, the answer has been with us for a long time, it's just a matter of looking in the right place. And where is the right place to look for the answer? Go straight to the source - the Creator of life would be the only One who could give us the true answer - and He has, in His Word - the Bible.
Ah, the Bible is a big Book to go through, though isn't it? Although it certainly wouldn't hurt you to read through the entire thing, and I encourage everyone to do so.
2 Timothy 3:16
All Scripture is God-breathed and is useful for teaching, rebuking, correcting and training in righteousness,
But in the meantime, let's answer the question.
The answer is given in Ecclesiastes by the wisest man who ever lived. He was given this wisdom by God Himself, to rule Israel.
1 Kings 3:11-14
So God said to him, "Since you have asked for this and not for long life or wealth for yourself, nor have asked for the death of your enemies but for discernment in administering justice, I will do what you have asked. I will give you a wise and discerning heart, so that there will never have been anyone like you, nor will there ever be. Moreover, I will give you what you have not asked for—both riches and honor—so that in your lifetime you will have no equal among kings. And if you walk in my ways and obey my statutes and commands as David your father did, I will give you a long life."
Even with his God-given wisdom and discernment, Solomon had his problems. He allowed himself to be led astray and to follow false gods.
1 Kings 11:6
So Solomon did evil in the eyes of the LORD; he did not follow the LORD completely, as David his father had done.
Ecclesiastes starts out with his search and claim that everything is meaningless. This man had it all - riches, wisdom, and power, yet something was still lacking. In the end, we find out that which was lacking was also the answer to our question.
After an extensive search for what was missing, and what would bring him satisfaction, Solomon finds that nothing does. This is detailed in the book of Ecclesiastes. Near the end of the book, we are given what Solomon learned through all his experience and searching.
Now all has been heard; here is the conclusion of the matter: Fear God and keep his commandments, for this is the whole duty of man.
There is a Commentary by Ray Stedman at the Blue Letter Bible that helps this fit together better and make more sense, answering the age old question.
In it, he explains that "duty" is in brackets, which means it was added by translators. If you remove that added word, the verse makes more sense.
Fear God and obey His commandments, for this is the whole of man.
Not our duty, but actually who and what we ARE - our very definition and the true meaning of life, the very essence of our being and the reason we were created. The answer was right there in the Bible all along!