Is it considered plagiarism when you modify your professor's proof when solving a problem in a homework assignment?
No, this bears no resemblance whatsoever to the concept of plagiarism. The goal of homework is to get you to review what you learned in class and demonstrate that you can apply it. That is exactly what you are doing.
Moreover, the purists who will wag their fingers at you and tell you to “cite” the earlier proof are part of why we have a generation of students who have no common sense understanding of what plagiarism is or what it means to plagiarize, and instead view the avoidance of plagiarism in terms of adherence to some mechanical set of algorithmic rules whose meaning they don’t understand (and I mean no offense to you personally, it isn’t your fault that you are being led astray in such a way by well-meaning but misguided — in my opinion — educators). The professor knows what they did in class, and know that you know it. There is no need to cite anything, just write a correct proof of the result you were asked to prove. If you want to mention that the proof is a variation of something that was done in class, that may be a nice way of showing a good level of understanding of the material, but it’s not required as some kind of plagiarism-avoidance algorithm.