I noticed that Duolingo uses "ta professeur" for "your (female) teacher". Is this correct? Can "professeur" take an article of either gender, and do all occupations work this way?
"la professeure" is very old-fashioned, and nowadays "le/la professeur" are both acceptable, or even more common "le/la prof" for short. But this is an exception (along with le/la docteur), as a great majority of occupations change according to the gender of the person, unless the masculin form already ends with an e - le/la secrétaire, le/la dentiste etc.
Usually if the masculine noun ends in -eur and the noun comes from a verb, the feminine form ends in -euse. Otherwise, the feminin form ends in -ice. Ex: "Chanter (verb)" --> Chanteur (m) --> Chanteuse (f) Or "Vendre (verb) --> Vendeur (m) --> Vendeuse (f) Acteur becomes Actrice, and in fact "to act" in French is not "act" (it's jouer or agir).
Some occupations have specific forms for the feminine, often ending -trice. So, for example, "Directeur" and "Directrice." Some of them have even trickled into English, like "Acteur" and "Actrice."
Not to mention "madame le maire" (Madam Mayor), or the title "maître" which is used for both male and female advocates.
And as for military ranks, confusion seems to reign. Officially I believe women take the same masculine ranks as the men, so it would be "le sergent Jeanne Dubois", but there seems to be a lot of variation. When I asked a French (male) officer whether it was correct to talk about "le lieutenant" or "la lieutenante" he replied "You tell me!"
Part of the problem is that "Madame la colonelle" traditionally referred to a colonel's wife, not a female colonel.
Not all occupations work this way, as some job titles completely change context depending on whether they are in the masculine or feminine. For example 'le couturier' is a fashion designer, whereas 'la couturière' means seamstress. The gender of job titles has actually been an active debate in France for years, linked to gender rights and equality. It is rare for genders to change the meaning of the occupation so dramatically, but I would suggest checking before using a different gender.