Answer fools according to their folly, or they will be wise in their own eyes. (NIV)
Answer a [self-confident] fool according to his folly, lest he be wise in his own eyes and conceit. [Matt. 16:1-4; 21:24-27.] (AMP)
Answer a fool according to his folly, lest he be wise in his own conceit. (KJV)