This particular verse and the next one have caused a stir among some who would like to think the Bible contradicts itself here. As usual though, when you actually study the text (rather than knee-jerk react to it) you will find no contradiction. You will find wisdom in dealing with fools - even those who have knee-jerk reactions hoping to discredit the Scriptures!
The wisdom given here in verse 4 is that we are not to answer a fool according to his folly because when we do so, we become just like the fool. The fool would ask whether the infinite God can create a rock bigger than he can pick up. If we answer him according to his folly, we will become like him. The unwise man will answer, "No," to this question. He thus falls into the trap set by the fool, who then jumps on the answer saying that then God is not infinite - because God cannot make the rock. The problem with this question is that it is foolish in its very presupposition. If God is infinite (which He is according to His self-revelation in Scripture) then by this very definition He is without limits in every way. The question presupposes God is either less than infinite in power to make the rock - or less than infinite in power to pick up the rock He makes. If God is infinite - any language that presupposes anything but infinite power and ability is by its very nature foolish. Don't answer the fool according to his folly - for in doing so you will become like him. You will make the same foolish presupposition that God can in any way be limited. You answered the fool within the scope of his foolish thinking. When a fool speaks this way - he proves he is a fool. These kind of questions do not seek knowledge or answer - they seek an opportunity to pounce on anyone who answers them. Therefore to answer them at all is to place yourself on the level of the fool - to make yourself just like him - a fool. Jesus spoke of not casting our pearls before swine - because they will trample them and then turn on us. To answer a fool in his folly is to cast pearls before swine.
There are times when Christians need to remain silent. Our lives and our faith should speak for us. Our wisdom at times is better revealed by saying nothing than it is by wanting to have an answer for everything. But there are times to answer a fool according to his folly. A better way to state this for our understanding is that we are to answer a fool as his folly deserves. So let's take a look also at verse 5 today - because it offers wisdom from the other way we need to deal with fools.
Answer a fool as his folly deserves, that he not be wise in his own eyes. When we answer fools it often does not need to be as they have questioned us. We don't need to get into the slop with them in their statements. But often we need to answer not their questions, but their spirit and their intent. Oh, how we need to watch Jesus on this one (actually we should watch Him all the time - but on this one He offers such great interactions with fools).
When I read the gospels I am always fascinated that Jesus answers some people's questions - and others He does not. He offers answers to his disciples when they question Him about certain things - but when he is asked questions by the foolish Pharisees and Saducees - He often answers their questions with questions - or with statements that reveal their heart. Here is how to answer a fool as his folly deserves. When Jesus asks a question to answer a question - He puts the responsibility to answer back into the court of the fool. Almost every time He did this - it revealed the wicked, foolish heart of the questioner. He answered as they deserved - and answered in such a way as to reveal the motives and heart of the one who wanted to trap Him. Here is true wisdom dear saints. He took the time to see past words to the intent of their heart. We err when we think our purpose is to simply answer the words of those who questioin us. What we need to do is to answer their heart. But the question naturally arises, "How can we answer the intent of someone's heart? How can we know this?"
Let me answer your question with a question. How well do you know the Word of God? How often do you discern what someone says using the Word of God? The reason I ask this question is because Hebrews 4:12-13 says, "For the word of God is living and active and sharper than any two-edged sword, and piercing as far as the division of soul and spirit, of both joints and marrow, and able to judge the thoughts and intentions of the heart. And there is no creature hidden from His sight, but all things are open and laid bare to the eyes of Him with whom we have to do." Do you see the highlighted part of this verse? It says that the Word of God can judge the thoughts and intentions of the heart. This means when we look at all things (including what a fool says to us) through the lens of God's Word, we will be able to see thoughts and intentions of the heart that are behind the words we hear. You ability to answer fools as they deserve to be answered will rest on your ability to see what they are saying through God's Word - and avoid the traps that your own ego or your own desire to put them in their place afford.
Why should a fool be answered? It is because he needs to experience God - and God's wisdom. If your desire to speak, as I said above, is because "you" want to put him in his place - well - then we have two fools speaking to each other. That kind of motivation comes from pride and a misplaced zeal that has little or nothing to do with God's honor and glory. Note in the gospels how many times the words of Jesus left men blown away with the wisdom with which He spoke. His answers left them with a touch of God. Do our answers do as much? You see, this is what we should covet. We should desire that whatever answer God has us give leaves them with a sense of God's wisdom.
Amazing isn't it that when we take the time to examine the full intent of God's Word - that seeming contradictions become some of the most wonderful truths. There is a large contingent of fools out there in the world. Our purpose needs to be to walk with God so that whether we are silent or speak - they do not run into us being God's vigilante - but rather they run into God Himself. In the end He will be the One who answers all their questions and statements. But He will do so bringing them to His desired humility for their lives - but also bringing them to Himself - and to His grace that can change their hearts from foolishness to wisdom - from their sinfulness to His righteousness - from being children of wrath to being children of grace. Honestly . . . isn't that what He wants in the end? He's not after some kind of prideful display where He puts them in their place - unless the place of which we speak is His salvation through grace.