CORRECTING, OPPOSING OR CONFIRMING ONE'S PARENT OR REBBI [Kivud Av va'Em: Hachra'ah]
Gemara
80b: Rav Yechezkeil was teaching a Mishnah to his son Rami: If Nisrafim (people sentenced to be burned) became mixed with Niskalim...
Rav Yehudah (Rami's brother): Father, do not teach that text. It connotes that the majority were Niskalim, we would stone them!
Shmuel (to Rav Yehudah): Do not speak that way to your father!
(Beraisa): If one sees his father transgress a Torah law, he should not say 'father, you transgressed!' Rather, he says 'father, is this what the Torah says?!'
Objection: This is equally embarrassing!
Correction: Rather, he should say 'father, the Torah says...'
Kidushin 31b (Beraisa): Fear of a parent... He does not contradict him, and does not Machri'a (decide an argument involving) his father.
Rishonim
Rif (Kidushin 13a), Rambam (Hilchos Mamrim 6:3) and Rosh (Kidushin 1:50): Fear of a parent... He does not contradict him, nor Machri'a him.
Rif and Rosh: If one saw his father transgress a Torah law, he should not say 'father, you transgressed!' Rather, he says 'father, the Torah says...'
Rambam (11): If one saw his father transgress a Torah law, he should not say 'father, you transgressed. Rather, he should say 'father, does the Torah say...?', as if he asks him, not like one who warns him.
Lechem Mishneh: The Gemara first said that the son should say 'father, is this what the Torah says?!' It rejected this, and concluded that he should say 'father, the Torah says...' Rashi explains that the first approach was, instead of saying 'you transgressed', he says 'see, this is not the law, for the Torah says...' We asked that this is just like saying 'you transgressed'! We answered that he does not mention what the father did at all. Rather, he just states the law, and the father understands by himself. The Rambam explains that the first approach was that he states the Halachah. We asked that this is like saying 'you transgressed'! We answered that he does not state the Halachah. Rather, he asks what is the law. This is honorable.
Rambam (Hilchos Talmud Torah 5:6): One may not be Machri'a his Rebbi in front of him, nor contradict his words.
Izuz Chayil (in Likutim in Frankel Rambam): 'In front of him' refers also to not contradicting his words.
Teshuvah ha'Rambam (Bloy 264, in Likutim in Frankel Rambam): Hachra'ah is when his Rebbi has a reasoning, and the Talmid says 'what seems to me is unlike Rebbi says.' This is forbidden, since there can be two opinions about the matter, and he may not be Machri'a his Rebbi's opinion due to his own.
Poskim
Shulchan Aruch (YD 240:2): He does not contradict him, nor Machri'a like his father in front of him, even to say 'father's words seem correct.'
Beis Yosef (DH Kosav): The Rambam (Hilchos Talmud Torah 5:6) forbids to be Machri'a like one's Rebbi in front of him. This implies that it is permitted in his absence, and all the more so regarding a parent.'
Beis Yosef (DH u'Mah she'Chosav Rabeinu): Rashi says that he is not Machri'a, e.g. to say 'Ploni (who argues with my father) is correct.' The Ramah says that there was no need to say this, for this is contradicting him! Rather, one may not say 'father's words seem correct.' We could say that there are two kinds of contradicting, i.e. direct contradiction, and saying 'Ploni is correct.' Alternatively, Rashi means that saying 'Ploni is correct' is Machri'a, whether Ploni is his father or the other opinion.
Ma'ase Roke'ach (cited in Mekoros v'Tziyunim in Frankel Rambam, Hilchos Talmud Torah 5:6): The Kesef Mishneh says 'if the Rebbi argues with another, the Talmid is not Machri'a like Acher (the other). This should say Echad (either of them, like the Beis Yosef explains the Rambam). However, the Kesef Mishneh implies that one may not be Machri'a even in his Rebbi's absence, unlike what he wrote in the Beis Yosef.
Taz (3): The Tur allows refuting those who argue with his father. The Tur himself argues with his father several times in Choshen Mishpat; this is not in front of him. It seems that if another holds like his father, he should mention only the other's name, but not his father's name. Whatever can be done honorably must be done. This is why the Tur (CM 107) disagreed with the Sefer ha'Terumos, without mentioning his father.
Gra (3): In many cases Chachamim argue with their Rebbeyim, e.g. Rebbi with R. Shimon ben Gamliel... They also are Machri'a. (This shows that it is forbidden only in front of him.)
Drishah (3): In CM 176:30, the Tur cites the Rambam and the Rosh, and says 'if not that I cannot be Machri'a, I would say that the Rambam is correct.' Why does he call this Hachra'ah? It is contradiction, according to the Ramah! Further, the Beis Yosef permits Hachra'ah in his absence! It seems that the Tur agrees in Siman 242. Really, the Tur did not refrain from Hachra'ah due to Kivud Av.' If so, he would have said so! Rather, he meant 'I am not great enough to be Machri'a this.'
Shach (2): The Drishah connotes that one may not contradict his father even in his absence. The Drishah explicitly says so (regarding one's Rebbi) in 242:20.
Be'er Sheva (Sanhedrin 110, cited in R. Akiva Eiger): All Poskim hold that the same applies to a Talmid contradicting his Rebbi. Surely this is when he has a reason to disagree. I say that he may disagree, just he may not say 'no, rather,...' His words must show honor, like we say in Sanhedrin 80b. If not for Rashi and those who follow him, I would say that the Isur to contradict a parent does not apply to Divrei Torah. We expound in Kidushin (30b) that a father and son, or a Rebbi and Talmid, when they engage in Torah, they become enemies. In the end, they will love each other. I.e. even though a son must honor his father, he does not refrain from contradicting his Divrei Torah. The Rosh says that Torah is Emes; we do not flatter ayone.
Atzmos Yosef (Kidushin 30a DH Afilu, cited in Pischei Teshuvah 1): The Gemara says that a father and son become enemies, i.e. they challenge and answer amidst debate of the Halachah. In such a case a son may ask against his father. This is not like the Isur to contradict one's father or be Machri'a him.
Shulchan Aruch (11): If one sees his father transgress a Torah law, he should not say 'father, you transgressed. Rather, he should say 'father, does the Torah say...?', as if he asks him, not like one who warns him, and the father will realize by himself and not be embarrassed. If the father said a mistaken teaching, he should not say 'do not teach that.'
Hagahos Tur ha'Shalem (25): Some texts of the Tur say 'since he mentions to him when no one else is there, he is not embarrassed.' Other texts say 'since he mentions to him, the father understands by himself, and he is not embarrassed.'
Rema (3): One may rule unlike his Rebbi if he has a proof against him.
Shach (3): Maharik (169) permits only if the Talmid became a Chacham. This is why Reish Lakish was able to argue with R. Yochanan. It is difficult to say that Reish Lakish argued only through reasoning (but one with a proof may argue even if he is not a Chacham.) The Terumas ha'Deshen (2:238) says that this is the way of Torah, from Tana'im, Amora'im and Ge'onim. One could say that it with permission, or after the Rebbi died. This requires investigation.
Gra (6): In many places, a Chacham argues with his father or Rebbi.
Shulchan Aruch (242:16): One may not be Machri'a his Rebbi in front of him, nor contradict his words.
Beis Yosef (DH u'Mah she'Chosav v'Lo Yeshev): The Rambam learns from the Isur regarding a parent, for one must honor his Rebbi even more. In his absence is permitted even for a Rebbi.
Taz (10): Contradicting him is forbidden even in his absence. However, regarding a Pesak it is permitted, like the Rema said in Sa'if 3.
Gra (52): In many places we find that a Chacham said 'my opinion seems more correct than Aba's.'
Ha'Emek She'elah (56:5): It was difficult to the Rishonim, for Chacham often argue with or are Machri'a their Rebbeyim. This fored them to say that the Isur is only in front of them. However, sometimes they argued in front of them! The Radvaz (1:495) forbids only when the Talmid fixes (a place) to rule unlike his Rebbi. Or, when voting, the Talmid does not count against his Rebbi. He may not argue decisively; he merely states his proofs; if the Rebbi rejects them, he is silent. The She'altos' text says 'he may not be Machri'a him unfavorably. I.e. we discuss an act, not Divrei Torah.