It depends what the role of the proof is.
In research mathematics, you're trying to convince people that some fact is true. To do this, you can draw on everything - almost every proof invokes things proved previously, whose proofs invoked things proved previously, whose proofs . . . Mathematics is an edifice which constantly builds on itself.
However, that's not the goal of a proof you're asked to write for a class. There, the point is to show that you understand the reasoning leading up to the result. Here you are not in general allowed to bring in facts from outside - that is, depending on what you're doing there may be some facts you're allowed to use, but generally the proof will need to be self-contained. And in specific cases (e.g. if you're asked to prove the uncountability of the Cantor set) there's no way of knowing what you're allowed to use in the proof without being in the class - personally I wouldn't let a student use Cantor-Shroeder-Bernstein or reference another text, since the proof is basic and the point is to demonstrate that you understand why the result is true; and by contrast, for more advanced results in set theory I'd let you use CSB without even mentioning it.
To see the tension between these, note that you can prove a new theorem without fully understanding why it is true! I've personally used technical facts in papers whose proofs I've never seen in detail, and this is standard practice.