Solution:
a.
Extend line AP to some point Q on the opposite side of P from A. Let R be the intersection of lines QO and PB, and let S be the intersection of lines AR and QB, as shown below.

By Ceva's theorem,
PAQP⋅OBAO⋅SQBS=1
It follows that
PAQP=QBQS
which means △QPS∼△QAB, therefore ∠QPS=∠QAB and so PS∥AB.
b.
Let PA and PB meet the circle again at points Q and R, respectively, and let S be the intersection of AR and BQ.

Then ∠AQB=∠ARB=90∘ since both angles are inscribed in a semicircle, so S is the orthocenter of △ABP, which means PS is the desired perpendicular.