Did my teacher ask it because it shows how proving the contrapositive can sometimes make life easy? Thanks.

Yep! Ideally, when you're posed with the problem of proving a statement, looking at its contrapositive should become second nature! With luck, you'll get to the point where you barely even notice the difference between A&rarr;B and ~B&rarr;~A!

Actually that is incorrect.
The negation of "irrational" is simply "not irrational". For a number to be "not irrational" has 2 cases. The number must be either complex (including i) or rational. Thus your statement of what the contrapositive is is not logically equivalent. This proof must be done by contradiction not by contrapositive.