8 This book of the law shall not depart out of thy mouth, but thou shalt meditate therein day and night, that thou mayest observe to do according to all that is written therein; for then thou shalt make thy ways prosperous, and then thou shalt have good success.

What is this "book of the law" that God refers to here? Is it the Pentateuch?

Rashi understands it to be referring specifically to the Book of Deuteronomy.

Metzodot David understands that it refers to the Law mentioned in the previous verse which the Malbim explicitly states refers to the entire Pentateuch. The Targum also implies that and I think it is the most straightforward read of the verses.

Even if as the others noted the actual book referred to is Deuteronomy or even all five books of the Pentateuch, the Talmud (Menachot 99B) understands the reference to refer at least symbolically to everything which is considered Torah.