Torah Command to Listen to Rabbis

The source from the Torah to observe the teachings of the Rabbis comes from פרשת משפטים. According to the ספרי, there are actually two Mitzvot involved in following the teachings of our sages.

The Pasuk is 17:11 in דברים and begins with the words, על פי התורה אשר יורוך, according to the Torah that they (the Rabbis) teach you. The verse continues with אשר יאמרו לך תעשה, that which they tell you, you should do. From these words, the ספרי tells us that this is the מצות עשה, positive commandment to follow the Rabbis.

From the end of the Pasuk that reads, לא תסורו מן הדבר אשר יגידו לך ימין ושמאל, that you shall not turn away from that which they tell you to the right or to the left, is the מצות לא תעשה, the negative commandment not to disobey the Rabbis.

So we see that the Oral Law and following Chazal, has its basis in the Torah.