Mutations (Treigladau) - some letters change depending on what are you saying. For example, arm is braich by my arm is fy mraich, your arm dy fraich (I think I've got that right) etc... I'm not great at them or at explaining them by Google treiglad or treigladau, there's three different types - soft/meddal, nasal/trwynol and llaes.
There are separate words Cymraeg for "related to the Welsh language" and Cymreig for "related to Wales".
So it can be the first one but not the second one.
I'm not sure whether it could also mean "a teacher who speaks the Welsh language (but teaches history and comes from Latvia)".
Pretty much. There are some tendencies (e.g. words with certain endings are usually feminine or usually masculine), but for most words, you can't tell and just have to learn it. (Some words even the Welsh don't agree on: they're feminine for some speakers but masculine for others.)
If you have to guess, "masculine" is statistically slightly safer.