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.
so does this mean something like "a teacher of the welsh language" or something like "a teacher of welsh nationality"?
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)".
Alright, then why is not "A teacher of Welsh" an acceptable answer in this task?
Cymraeg in this case is acting as an adjective 'Welsh-language'. Adjectives undergo soft mutation following feminine nouns. Athrawes is a feminine noun...
If they're accepting 'actress' for 'actores' then for consistency's sake they should accept 'female teacher' for 'athrawes' even though the latter isn't idiomatic English.
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.