Note that, taking x= 5 in the first equation, 5p(4)= 0 which means that p(x) must have a factor of the form x- 4. Write p(x)= (x- 4)q(x) and the first equation becomes xp(x- 1)= x(x- 1- 4)q(x- 1)= x(x- 5)q(x-1)= (x- 5)(x- 4)q(x)) or xq(x-1)= (x- 4)q(x).

Taking x= 4 in that says that 4q(3)= 0 so that q has a factor of x- 3. Write q(x)= (x- 3)r(x) and xq(x-1)= (x-4)q(x) becomes x(x-1-3)r(x-1)= x(x- 4)r(x-1)= (x-4)(x-3)r(x) so xr(x-1)= (x- 3)r(x).

Get the point? Keep going and you eventually get to xy(x-1)= xy(x) so that y(x- 1)= y(x) for y a polynomial. That is only possible if y is a constant. If that "!" in p(6)= 5! is a factorial rather than punctuation, it is particularly easy to find that constant.