I had a class in college in which we had to prove something like 0*a = 0 for all a on a test. What you’re asked to do basically is to use the axioms of arithmetic along with the few things shown in class that were proven using those axioms. That was the only class where we really couldn’t use everything we knew about mathematics in our proofs, but the concepts were extended in other classes in the sense that one learned how to be rigorous in that class. You were expected to always prove any statement that hadn’t been proven in class, regardless of how obvious it was. If it was obvious, you could just write down the few lines to prove it. If it wasn’t obvious but came up a lot, it would be gone over in class.
But for mathematics papers in general, they will usually freely declare certain things as obvious that are from it, because the techniques needed to prove them are not particularly difficult. You might need to prove some general element has a certain property and it takes several pages to do so only because you need to consider every case and work through the details each time, but all of that logic is very mechanical in nature. A professor called it “following your nose”, and such results were quite often called “obvious” even if a tremendous amount of work was involved in rigorously proving it, and jokes about this process are often made. In general, just like in class with frequently used results, there are going to be plenty of non-obvious “obvious” things that people will have already agreed upon as having been settled and can be used freely. I don’t remember the details, but I recall an instructor giving a long proof through Zorn’s Lemma to show something and said at the end of it “of course, most of the time we don’t go through all this, we just say it’s true via Zorn’s Lemma, and everyone knows the process to go through”.
How do you know what you’re allowed to do in general? Well, generally you are allowed to use anything that has been shown to be true to you in the group with which the problem is presented. That is, if it’s for a class, use only things proven or stated as axioms for that class. If it’s for your own use, use anything that you’ve proven to be true yourself. When you get into publishing papers, you generally use the results of any other paper published, and you cite them.