The pairs (p,q) satisfying the given equation are those of the form p(x)=ax+b,q(x)=cx+d
for a,b,c,d such that bc−ad=1. We will see later that these indeed give solutions.
Suppose p and q satisfy the given equation; note that neither p nor q can be identically zero.
By subtracting the equations
p(x)q(x+1)−p(x+1)q(x)p(x−1)q(x)−p(x)q(x−1)=1=1,
we obtain the equation
p(x)(q(x+1)+q(x−1))=q(x)(p(x+1)+p(x−1)).
The original equation implies that p(x) and q(x) have no common nonconstant factor,
so p(x) divides p(x+1)+p(x−1). Since each of p(x+1) and p(x−1) has the same degree and leading
coefficient as p, we must have
p(x+1)+p(x−1)=2p(x).
If we define the polynomials r(x)=p(x+1)−p(x), s(x)=q(x+1)−q(x),
we have r(x+1)=r(x), and similarly s(x+1)=s(x).
Put
a=r(0),b=p(0),c=s(0),d=q(0).
Then r(x)=a,s(x)=c for all x, and hence identically;
consequently, p(x)=ax+b,q(x)=cx+d for all x, and hence identically.
For p and q of this form,
p(x)q(x+1)−p(x+1)q(x)=bc−ad,
so we get a solution if and only if bc−ad=1, as claimed.