When Yosef told his brothers who he was, the Torah says ולא יכלו אחיו לענות אותו כי נבהלו מפניו"," "his brothers could not answer him for they were overwhelmed by him" (בראשית מ"ה:ג'). The Midrash suggests that Yosef rebuked his brothers at that time, yet there is no mention of rebuke. Yosef says only "אני יוסף," "I am Yosef" (שם). Where is the rebuke, the תוכחה, to which the Midrash here refers?
Actually, giving תוכחה does not necessarily mean yelling at someone; it rather means letting someone know the truth. Yosef's brothers sold him into slavery thinking they had a good reason, namely, to prove that his glorious dreams meant nothing. However, selling Yosef to disprove his dreams was actually the first step to the fulfillment of those dreams. Yosef's statement "I am Yosef"proved to the brothers the truth; he was not just a dreamer, but a prophet conveying his prophecy.
The Midrash further quotes that Rabbi Shimon Ben Elazar, upon the thinking of this Posuk, exclaimed, "woe unto us because of the day of rebuke." We see, he said, that the youngest of the brothers caused so much shame to his older brothers, leaving them speechless, just by revealing the truth. How much greater will our agony be, then, when Hashem eventually reveals to us how filled our lives were with mistakes. Similarly, Rabbi Chaim Shmuelevitz points to the reaction of Yitzchak when he found out that his beliefs about Eisav were wrong, and that he was indeed wicked. The Posuk says that Yitzchak shook with a very mighty tremble (שם כ"ז: ל"ג). Some say he trembled then even more than he trembled on the Mizbeiach at the time of the Akeidah. This great fear came from realizing that he had been wrong all this time and that Yaakov was actually the righteous son. That moment of truth was indeed a moment of trembling.
What causes a person to be ashamed is the realization that he has acted on the wrong beliefs. One then sees that all he has done was commit one continuous error. When one works for something, but discovers that the basis of his goals has disappeared, he sees that his work has been for naught. When the brothers threw Yosef into the pit to destroy his dreams, they knew their action was wrong, but felt the outcome justified it. When someone acts improperly, feeling that the goal justifies the action, and then finds out that the goal is false, that act stands out as very shameful. When the brothers realized that Yosef's dreams were true, they understood that selling him was then truly sinful and their shame was great.