in triangle ABC, PandQ are points on BC such that BQ=CP and AP=AQ.show thatAB=AC

In this case, APQ forms an isoceles triangle, which you'll see if you draw a figure. (AP=AQ)

So, ∠APQ = ∠AQP
=> 180 - ∠APQ = 180 - ∠AQP
=> ∠AQB = ∠APC .....1

Now, consider triangles AQB and APC
AP = AQ (Given in the question)
∠AQB = ∠APC (From ...1)
QB = PC (Given in the question)

Hence, the two triangles AQB and APC are congruent by the SAS rule.

Since the corresponding parts of congruent triangles are equal, AB=AC