How did you learn to write (correct) proofs?

Proofs usually have different approaches based on the field. For proofs involving infinite sets typically you show it holds for an arbitrary element of the set and since it didn't matter which element it holds for it holds for every element in the set. For your example you would have to use a proof method known as mathematical induction, and the definition of evenness/oddness (the simplest to use is that an even number is 0 when reduced modulo 2 and an odd number is 1 reduced modulo 2).

This is something you just get better with over time. My recommendation is to look at chapter 0 or 1 of your textbook, in my experience no matter how far you make it into math the first chapter is always a brief overview of dealing with sets and proofs. Also, I recommend you read a book specifically teaching you how to read and write mathematical statements and proofs.

How to prove it is one example.

An alternative is: An introduction to mathematical thinking: algebra and number systems, which I learned from and loved.

These books only show you how to begin, arguments do get much more sophisticated than them and typically you'll need to do some proof based calculus ('introductory analysis'), abstract algebra, proof based linear algebra (kind optional, the thinking is very similar to abstract algebra).

/r/math Thread