Do you always need to watch out for "limitations?" How do you memorize them?

I have a question about "limitations" given within any theorem. For example: Rolle's Theorem states:

So the limitations would be: "Let f be continuous on the closed interval [a,b] and differentiable on the open interval (a,b). If f(a)=f(b)..."

Do you always have to keep this limitations in mind when using theorems? How do you recommend remembering them?

For your own experience, do exams tend to trick students by putting questions that invalidate the limitations? I think that my teacher has given me a couple.

You MUST, MUST know the conditions of a theorem to hold. Otherwise you WILL sooner or later use them when they don't apply. And checking for the conditions is something you will always be doing when carrying out proofs.

Experience; the more you use it, the better you remember it.

It's also good practice to study counterexamples. e.g. can you find a function f on [0, 1] with f(0) = f(1), but such that there is no c such that f(c) = 0? Once you've done that, can you find a continuous f? Now what if f is differentiable, but [itex]f(0) \neq f(1)[/itex]?

The idea is to make the hypothesis of the theorem as weak as possible - to a practical extent - so that you can apply the conclusions of the theorem to more situations. But there are some cases where the weakest possible hypothesis is not practical in a given context, so you may see theorems proved with hypothesis not as weak as possible.

But as for Rolle's Theorem, Mean Value Theorem, etc., if you are interested in the theorem at all (beyond just solving calculus problems) then you would want to know that f doesn't need to have derivatives at the endpoints!

Learning the counterexamples is an excellent suggestion. I sincerely doubt you should be memorizing all of the theorems by rote. Instead, being able to master the mindset that led to the creation of that theorem is what you should be aiming for, so if you can't teach it to somebody else via the Socratic method, and they can't figure out why the limitations matter, that's when you should probably start seeking out additional help.

Let f be continuous on the closed interval [a,b] and differentiable on the open interval (a,b). If f(a)=f(b), then there is at least one number c in (a,b) such that f'(c)=0

Another way to remember is to understand that functions aren't always differentiable on the boundaries.

That's why when you optimize in single variable, and later, multi variable calculus, you must explicitly check the boundaries for the absolute extremum.