How should students react to inaccuracies in professors' teaching without causing resentment I am an undergraduate in the UC system.  I sometimes encounter situations where professors or TA's make errors, or there are inaccuracies in the material.  These situations tend to be quite awkward for both the student and the TA or professor.  

It is painful for me not to speak up, but there is a fear, possibly exaggerated, that this could lead to resentment by the TA, or professor, or even future unfair treatment.  

The most frequent response by senior students is that the professor is always right, and you should never attempt to argue with the professor. Confronting a professor about a misconception could end up being detrimental to the student in the long run.  

What should a student do (and how?) when a teacher makes an error or gives inaccurate information or material?  Is there any reasonable way to anonymously point out mistakes?
I think your fears may be exaggerated.  I can't think of a professor I've ever met who I think would be offended by having a mistake (politely) pointed out, much less retaliate.

Accusing anyone flat-out of being wrong, or worse yet, lying, will certainly make them defensive; and if it turns out they were right, it will be more embarrassing for you.  So I don't suggest thinking of it as "confronting" the professor.  What I would suggest instead is to approach the question as something that you don't understand.  "Hi Professor Smith, in class today you said X.  But I'm confused, because I thought that Y."  Listen to her response.  Be open to the possibility that you are mistaken, or have misunderstood what she said, but if your doubts aren't cleared up, figure out what part still seems wrong to you, and ask about that.  "I still don't understand; what about...?"  Stay calm and polite.  If you find you are getting worked up (or she is), take a break.  "Let me think about that, and if I still have questions I'll come back later."  Hopefully in the end, everyone agrees on where the truth lies, and nobody feels too embarrassed.

If you think she's simply misspoken about something in class, or written something incorrectly on the board, point it out right away: "Is that X supposed to be a Y?"  If there's something deeper, it may be better to discuss it in office hours or by email; I know that when I'm teaching, if I think I may have a serious mistake, I get flustered and it throws off my rhythm.  I'd rather have time to think about it offline, and then correct the error in the next class.

I think the other comments saying "Be sure you are right!!!" are excessive.  It's not a bad idea to try to think carefully about your question; if you can clear it up yourself, you'll learn better.  But don't hesitate to talk to the professor.  Even if it's you that's confused, part of my job as a professor is to clear that up.  And if it turns out I'm wrong, of course I want to know.

Your suggestion of having some sort of middleman to anonymously forward queries strikes me as a bit extreme.  Again, I think you may be more intimidated by your professor than is really warranted.  It may help to try to get to know your professors better: early in the course, make it a habit to drop by their office hours.  Ask some trivial questions if you like.  "Are we going to study Z next week?"  Then later, if you have more substantive questions or concerns, you'll feel more comfortable approaching them.

Anonymity seems unnecessary and perhaps counterproductive.  If you come to me with something you don't understand, and I'm able to clear it up, I won't think less of you; instead, I'll be pleased that you now understand it better.  And if it turns out I was wrong, I won't resent you; I'll be impressed that you understand the issue deeply enough to spot the error, and grateful that you brought it up.  But if you're really timid, you could consider sending an email from an anonymous account. ("I'm sending this anonymously because I'm embarrassed that it may be a silly question."  Either way she'll probably assure you that it isn't.)

One final comment: If you have mentors suggesting that professors are never wrong, find better mentors!  I agree that it is not pleasant to argue with anyone, but that doesn't mean you can't discuss your question and try to sort it out.