Answer
Papal infallibility is the doctrine that the Pope, when speaking ex cathedra on matters of faith and morals, is preserved from error by the Holy Spirit. This means that the Pope cannot teach anything that is contrary to the deposit of faith. The doctrine was defined by the First Vatican Council in 1870, and it is one of the core beliefs of the Catholic Church.