We will use the following lemma:
Lemma 1. Let AD be a median in triangle ABC. Then cot∠BAD=2cotA+cotB and cot∠ADC=21(cotB−cotC).
*Proof.* Let CC1 and DD1 be the perpendiculars from C and D to AB. Using signed lengths, we write
cotBAD=DD1AD1=21CC121(AC1+AB)=CC1CC1cotA+CC1(cotA+cotB)=2cotA+cotB.
Similarly, denoting by A1 the projection of A onto BC, we get
cotADC=AA1DA1
=AA121BC−A1C=AA121(AA1cotB+AA1cotC)−AA1cotC=21(cotB−cotC).
□
Turning to the given problem, by the lemma we get
cotBPD=2cotBPC+cotPBC=2cotBFC+cotPBC(from circle BFPC)=2⋅21(cotA−cotB)+2cotB+cotC=cotA+cotB+cotC.
Similarly, cotGQF=cotA+cotB+cotC, so ∠GPR=∠GQF and GPRQ is cyclic.