Let $p$ be a prime. Determine all polynomials $f(x) \in \mathbb{F}_p[x]$ for which there exist polynomials $A(x), B(x) \in \mathbb{F}_p[x]$ such that $f(x) = A(x)^2 + B(x)^2$.
If we were working with $\mathbb{F}_p$ elements instead of $\mathbb{F}_p[x]$ elements, by noting that there are $\frac{p+1}{2}$ squares mod $p$ we see that for fixed $a$ the sets $\{a - b^2: b \in \mathbb{F}_p\}$ and $\{c^2, c \in \mathbb{F}_p\}$ have a common elements, so in fact every $a\in \mathbb{F}_p$ is a sum of two squares!
Could some similar approach be used for $\mathbb{F}_p[x]$ or completely different things are going on? Any help appreciated!