The value of p and q for which the function is continuous for all x in R, are:
Know your College Admission Chances Based on your Rank/Percentile, Category and Home State.
Get your JEE Main Personalised Report with Top Predicted Colleges in JoSA
f(0) = q
= (p + 1) + 1 = p + 2