How do you learn spells when you master your school and does nything happen when you master other schools and what happpens when you master all magic?
1) all spells past level 42 are school-only quests given by your professor. Once you meet the level/quest requirement, s/he will summon you via a pop-up on your screen.
2) you can't master other schools; see above. You can, however, buy a mastery amulet for $20 in the crown shop and use the treasure card versions of those spells.
Mastering a school does nothing but give you a badge. You cannot master other schools and even if you could it would be a huge waste of training points. To master a school and earn a badge you must learn all the spells up to lvl 48 (which is a school-only quest spell). All spells learned after lvl 42 will be given out in quest form except for a few utility spells that you learn from other trainers you find along the way.