16 The first title is founded upon the express mission and supreme authority to teach, given her by her divine Founder: "All power is given to me in heaven and in earth. Going therefore teach ye all nations, baptizing them in the name of the Father, and of the Son, and of the Holy Ghost, teaching them to observe all things whatsoever I have commanded you, and behold I am with you all days, even to the consummation of the world." Upon this magisterial office Christ conferred infallibility, together with the command to teach His doctrine. Hence the Church "was set by her divine Author as the pillar and ground of truth, in order to teach the divine Faith to men, and keep whole and inviolate the deposit confided to her; to direct and fashion men, in all their actions individually and socially, to purity of morals and integrity of life, in accordance with revealed doctrine."
Source: Divini Illius Magistri (Vatican.va)