By the rational root theorem, we have several possible candidates for roots: [tex]\pm1,\pm2,\pm3,\pm6[/tex]
Plugging each of these options in, you find that [tex]p(x)=0[/tex] for [tex]x=1,2,3[/tex]. The polynomial remainder theorem states that [tex]x-c[/tex] is a factor of [tex]p(x)[/tex] if and only if [tex]p(c)=0[/tex].
This means
[tex]p(x)=(x-1)(x-2)(x-3)[/tex]