Self mutilation could be many of possible reasons. I agree with you that sm is stupid if you're doing it over bad breakup. Lets say problems run deeper than that. Lets put things into perspective and say that not only a bad breakup but everything in their life has fucked up.
But what do you say to someone who does it for attention? I'd say they're seriously messed up in the head.

i got this from a site.
Self-injury is a coping mechanism, a way to stay alive. People who inflict physical harm on themselves are often doing it in an attempt to maintain psychological integrity it's a way to keep from killing themselves. It reduces physiological and psychological tension rapidly.