The み is what's called "okurigana". Many words are composed of a kanji with kana that follow it (or rather, perhaps we should say that when we write the word いたみ we can write いた+み where いた can be in kanji).
In this case there's a verb, 痛む which means "to hurt", and 痛み is a noun form of the same verb.