TITLE: Irreducible polynomial not attaining squares over finite field
QUESTION [6 upvotes]: Is it possible to construct an irreducible polynomial $f$ over $\mathbb{F}_{q}$ such that $f(x)$ is a non-square for any $x \in \mathbb{F}_{q}$?
I can prove the existence of irreducible polynomials (Euclid's argument), and I can construct polynomials with no square values (for example by Lagrange interpolation through non-squares), but satisfying these 2 conditions feels difficult.
Motivation: I am trying to construct an hyper-elliptic curve $y^2 = f(x)$ with no rational points.
EDIT: Can you construct such an $f$ that will not be constant on the ground field $\mathbb{F}_{q}$?

REPLY [3 votes]: Let $h$ be any function $\mathbb{F}_q \to \mathbb{F}_q \setminus \{ 0 \}$. Then there is an irreducible polynomial $f$ such that $f(x) = h(x)$ for all $x \in \mathbb{F}_q$. In particular, if we choose the values of $h$ to be non-squares, then there is an irreducible polynomial achieving these values. For $p \geq 5$, this answers the question of whether we can make $f$ nonconstant.
Proof By Lagrange interpolation, there is some polynomial $b(x)$ which coincides with the function $h$ on $\mathbb{F}_q$. Consider polynomials of the form $f(x) = a(x) (x^q-x) + b(x)$. Any such $f$ is equal to $h$ on $\mathbb{F}_q$. We have $GCD(x^q-x, b(x))=1$, since $h$ is nonzero. Dirichlet's theorem on primes in arithmetic progressions holds for $\mathbb{F}_q[x]$ (see Chapter 4 in Rosen's Number theory in function fields), so there is an irreducible polynomial of the form $(x^q-x) a(x) + b(x)$.