Autocorrelation test for AR(p) (Breusch-Godfrey LM test) I have a question regarding the test for the error term.
As you know, in AR(p) model

The error term must be i.i.d., so after the regression I want to see if there is no serial correlation in the error term.
The text book says Breusch-Godfrey's LM test is designed to test autoregression in the error term model such as

I wonder if we can use BG's LM test to test serial correlation of the error term in AR(p) model. Is it okay to counstruct the auxiliary regression as usual? By the way, I already know Ljung-Box's Q test.
Thanks, in advance.
Yes you can use  Breusch–Godfrey  (BG) test for autocorrelation also in AR(p) models and dynamic models in general (see Verbeek Guide to Modern Econometrics where BG is applied to dynamic models in some examples - one of such examples is on page 142 in the 4th ed). As a matter of fact BG test is, generally speaking, the preferred test for autocorrelation in AR models and dynamic models  (see Maddala Introduction to Econometrics).
Furthermore, actually Ljung-Box's Q test should not be used for testing AR processes or other dynamic models with lagged dependent variable. The reason for that is that this test is in the models with lagged dependent variable biased towards the null hypothesis. This is because in such models the Ljung-Box's Q test no longer has asymptotically $\chi^2 $ distribution (see the Maddala textbook above for further discussion of this issue).