סימן כט סעיף טז
בְּמֶה דְּבָרִים אֲמוּרִים כְּשֶׁהוּא מְדַמֶּה שֶׁיִּשְׁמַע לוֹ. אֲבָל אִם יוֹדֵעַ בּוֹ שֶׁלֹּא יִשְׁמַע לוֹ, אָסוּר לְהוֹכִיחוֹ, דְּאָמַר רַבִּי אִילְעָא מִשּׁוּם רַבִּי אֶלְעָזָר בְּרַבִּי שִׁמְעוֹן, כְּשֵׁם שֶׁמִּצְוָה עַל אָדָם לוֹמַר דָּבָר הַנִּשְׁמָע כָּךְ מִצְוָה עַל אָדָם, שֶׁלֹּא לוֹמַר דָּבָר שֶׁאֵינוֹ נִשְׁמָע. רַבִּי אַבָּא אוֹמֵר חוֹבָה שֶׁנֶּאֱמַר אַל תּוֹכַח לֵץ פֶּן יִשְׂנָאֶךָ, הוֹכַח לֶחָכָם וְיֶאֶהָבֶךָ. (יבמות דף ס"ה ע"ב) (אוֹרַח חַיִּים סִימָן תר"ח)
This applies only in a case when you [have reason to] believe that the sinner will listen to you,49If the sinner is your friend you should chide him even if you know that he will pay no attention to your words. (Magein Avraham 156:2) but when you know [for sure] that he will not pay attention to your words, then you are forbidden to admonish him. For Rabbi Ila'a said in the name of Rabbi Elazar ben Rabbi Shimon,50Yevamos 65b. "Just as it is a mitzvah for a person to say something that will be heeded, so it is a mitzvah to refrain from saying something that will not be heeded." Rabbi Abba says, "It is his duty" [to refrain from saying anything that will not be taken under consideration]. for it is said:51Proverbs 9:8. "Do not admonish a scorner lest he hate you; reprove a wise man and he will love you."
תנא דבי אליהו כל השונה הלכות בכל יום מובטח לו שהוא בן העולם הבא שנאמר הליכות עולם לו אל תקרי הליכות אלא הלכות (נדה ע"ג.)