I've told my ESL students that I'm has the same meaning as "I am". But the other day I came across this (written by someone from Spain): "Here I'm if you need me." Sounds really strange, right? It has to be "Here I am if you need me."
Also ... Where's my book? Oh! Here it's. (But "Here it is." would sound perfectly OK.)
Also ... Are you the teacher? Yes, I'm. (But "Yes, I am." again sounds fine. As does, "Yes, I'm the teacher.")
Is there some general rule as to when the contraction should not be used?
Remember - if you don't use correct capitalisation, punctuation and spacing, anything you write will be incorrect.