At the end of the 19th century and turn of the 20th, both Catholic and non-Catholic historians and theologians produced the best works on the papacy and papal infallibility, largely due to Vatican I and the dogmatising of papal infallibility in 1870. Fortunately, many of these fine works are available online and have been reprinted in recent years.
The best works refuting the papacy and papal infallibility one can read would be:
Edward Denny, Papalism: A treatise on the claims of the papacy as set forth in the encyclical Satis Cognitum (this is perhaps the best text refuting the papacy from early Christian writings. If one will only read one work against the papacy, this is the text to read)
George Salmon, The Infallibility of the Church
Catholic historian, Dom John Chapman, wrote two good volumes defending the papacy:
Studies on the Early Papacy – Catholic apologist, Phil Porvaznik, has many of the chapters available online under the section, St. Peter, the Papacy, and Apostolic Succession
For more, see my Bibliography on the Papacy and Papal Infallibility