Proverbs 26:4-5 (NIV)
Do not answer a fool according to his folly, or you will be like him yourself.
Answer a fool according to his folly, or he will be wise in his own eyes.
The book of Proverbs is a collection of wise sayings. How wise can it be to contradict yourself though? Which is it, answer the fool or not? These two verses are a classic "proof" that the Bible cannot be inspired, otherwise the author would not have so obviously contradicted himself. However, because this contradiction is so obvious and immediate, it deserves a close inspection. Let's analyze the two proverbs separately.
In the first proverb, we are told not to answer a fool so that we will not become a fool ourselves. The idea here is that being drawn into a fool's dialog would bring you down to his level. The verse says that answering a fool would cause us to "become like him." What are the fool's methods of argument? Anger, rudeness, speaking without thinking first. Using such tactics is certainly foolish and it is too easy to respond in kind. So here is some wise advice: don't fall into the fool's trap.
In the second proverb, we are told to answer a fool. This time, however, an answer is given to prevent the fool from thinking himself wise. The idea is that your silence would somehow admit defeat at the fool's "superior logic", giving credence to his folly. If that happens then the fool's behavior is reinforced and others might stumble, not discerning the truth. It is therefore a duty to correct, rebuke, and expose a fool. Such wisdom comes out of a love for truth and a love for others, including even a love for the fool.
So how do you unify these two seemingly contradictory bits of wisdom? I believe you must ascertain the situation, i.e. whether critical error could be propagated. Then, when warranted, carefully respond to correct the error in a kind, reasoned, and authoritative way.
One interesting point to note from the existence of such "contradictions" is that a short little proverb cannot be applied to every situation. A truth like "love your neighbor as yourself" applies to every situation. This is the distinction between wisdom and truth. Wisdom is applied truth. The situation may change, but truth never changes.