Let $\mathbb{F}$ be some finite field.
Let $Q(x, y)\in\mathbb{F}[X,Y]$ and $P(x)\in\mathbb{F}[X]$ such that $Q(x, P(x)) = 0$ for every $x\in\mathbb{F}$.
Prove that $Q(x, y) = (y - P(x))A(x, y)$ for some polynomial $A(x, y)$, i.e. $y-P|Q$.
I must say I am stuck and I don't know how to prove this fact.