When you're solving a problem, the concept of invariance is used extremely often.
Here is a simple explanation of the concept when applied to loops by Thomas Cormen (the C in CLRS). He talks about loop invariants.
Loop invariants is one specific example of invariance. It actually comes up in a lot of algorithms such as dynamic programming, recursion, divide-and-conquer, greedy algorithms, and so on.
It is really helpful to explicitly try and think about problems you have solved in the past from the invariance point of view. What's invariant in merge-sort? In quick-sort? In binary search? In your 3 most favorite dynamic programming problems?