In answering this question, I like to point to Proverbs 1:7,
"The fear of the Lord is the beginning of knowledge: but fools despise wisdom and instruction."
However, I have not as of yet explained any reason why we should trust the Bible, and do not intend to do so here. So let us constrain our discussion of the foundation of knowledge to the realms of philosophy and logic. Looking at it in this way, we reach the same conclusion, that is, God is the beginning and standard for knowledge.
In this series' first post, we learned that there has to be absolute truth and morals for society to survive. But men do not all agree about what those truths and morals are, so they do not supply an obvious standard for truth. Simply, there must be something more than man to provide a standard - someone perfect, someone eternal, someone immutable. In other words, there has to be a God to define that standard. Francis Schaeffer explains this need in How Should we Then Live?,
"If there is no absolute beyond man's ideas, then there is no final appeal to judge between individuals and groups whose moral judgments conflict. We are merely left with conflicting opinions. Yet to say that no judgements are universally true is absurd. Every instinct within us tells us that at least some moral judgments are absolutely correct."
Do you doubt this belief? That's ok, Descartes comes to the same conclusion, precisely because he can doubt.
Most famous for his maxim, Cogito ergo sum - "I think, therefore I am," Descartes would continue his philosophy to explain why he believes in God.
It all starts by acknowledging that Descartes doubts. He was skeptical of the world and not long ago coubted his very own existence. Further, Descartes understands that to doubt is to discern perfection from imperfection.
From here, Descartes reasons correctly that an image of perfection (by which we compare our doubts) doesn't come from thin air. Indeed it must come from a perfect being. For instance, if we saw a three-legged chair, we would say that the chair is broken because we know a chair is supposed to have four legs. If we had never seen a chair before, we would have no mechanism to understand what was amok with the chair. We would have nothing to which to compare it. Similarly, we would be unable to doubt about the perfection of this world if there was no perfect being to compare it to. Thus, because Descartes doubts, he believes there has to be a perfect being in existence.
Douglas Wilson explains Descartes' beliefs (describing the problem of evil) in a much simpler, succinct way as,
"It is far better to believe in God and acknowledge the problem of evil than to be an atheist and to have no way of even *defining* the evil that you have mysteriously come to believe constitutes such a problem."
Any imperfection in our world, whether it be evil or just the acknowledging of a lie in this world is only known to be wrong because we have a being perfect in all his ways, moral and otherwise, to which we can compare the world. This perfect being is known as God by many throughout this world - the only perfect being from which we get our ideas of both perfection and imperfection.
Thus is how we can attain knowledge of right and wrong or anything else - from the Lord.