Let f(x)=(x−α)(x−β)
It is given that f(0)=p⇒αβ=p
and f(1)=31⇒(1−α)(1−β)=31
Now let us assume that α is the common root of f(x)=0 and fofofof(x)=0
fofofof(x)=0
⇒fofofof(α)=0
⇒fofof(0)=0
⇒fof(p)=0
So, f(p) is either α or β.
Now assuming (p−α)(p−β)=α
⇒(αβ−α)(αβ−β)=α⇒(β−1)(α−1)β=1
⇒3β=1 (as (1−α)(1−β)=31)
So, β=3
Now finding α by putting the value of β in (1−α)(1−β)=31,
⇒(1−α)(1−3)=31
⇒α=67
So, f(x)=(x−67)(x−3)
So, f(−3)=(−3−67)(−3−3)=25