"Math, shmath." basically means, "Math? What nonsense! I don't care about that."
We repeat the word with "shm-" or "schm-" as the first consonant to show our disdain. To me, this is an Americanism. I'm not sure, but I think there's a Yiddish connection somewhere. Perhaps one of the US members can throw more light on this.
Math, schmath! Science, schmience! Legality, schmegality! Work, schmerk! Boyfriend, schmoyfriend!