I'm trying to understand the following, which seems obvious in some papers that I've read, but I couldn't find a proper proof for it.
Let $q$ be an arbitrary prime power, and let $g \in \mathbb{F}_q$ be a generator of the multiplicative group $\mathbb{F}_q^*$. It is easy to verify that $E(Y) = Y^{q-1}-g$ is irreducible over $\mathbb{F}_q$.
I don't understand why $\forall f(Y)\in \mathbb{F}_q[Y]$ it holds that $$f(Y^q) \equiv f(gY) \bmod(E(Y)).$$
It is only necessary to prove this for monomials $f(Y)=Y^s$.
Then modulo $Y^{q-1}-g$ we have $$ Y^{sq}-g^s Y^s =Y^{s(q-1)}Y^s-g^s Y^s =g^sY^s-g^s Y^s=0. $$