Verses 7-9: Spoken by Lady Wisdom, she offers suggestions about how to address certain characters–good and bad–and the results of interaction with each one.
Verse 7: Speaks about addressing issues with a “mocker” or a “wicked man”–efforts that will not lead to anything positive. Both will just respond to “correction” and “rebuke” with “insults” or “abuse.” Better to say nothing at all!
Verse 8: Rebuking a mocker is futile. These verses are sort of proverbial forerunners of Jesus’ statement to not “cast pearls before swine” (Mt 7:6). If we feel we must correct these guys, just know it will not go well.
Verses 8-9: On the flip side, are the good guys. “Rebuke a wise man” brings a totally opposite response – he will appreciate your efforts (“love you”). “Instruct” or offer him discipline and he will get even wiser.
Verse 9: Teach a “righteous man” and he will benefit from it. The effort will a good investment of my time, too.
One of the great truths of Proverbs is that sometimes we need to speak up and sometimes it is better to shut up. The key is just to know with whom we are dealing.