I am currently on a pure maths course at university having done an undergrad degree in mechanical engineering. This course skips most elementary introductions/expects you to already be familiar with the basics. As such I have been covering introductions to logic, set theory, and proofs on my own.
I have finished a book on proofs and read another book's section on proof techniques etc. I feel quite comfortable with most of the proof exercises in these books. However I sometimes struggle to bridge the gap between the sorts of proof exercises given, and writing actual proofs in relevant courses.
The main issue I am struggling with is not knowing whether or not my proof is rigorous enough in certain situations. In the proof books, I found I quite enjoyed most of the problems, because the proofs seemed especially 'well-defined'. For example in proofs about sets concerning arbitrary unions/intersections and their relationships etc, there tended to be a very clear cut way of writing out a series of implications or equivalences in first order logic until I reach the statement I was proving in the first place. In this sense I was sure of my work and steps, and it's is clear in my mind what steps I have taken and why.
I also feel like in these sorts of proofs, I at least have a way of seeing how a bridge between what I have written, and a 'rigorous' formal proof could be made, using rules of inference between each step etc.
However in most of my courses, the proofs feel different, possibly with the exception of some of real analysis. As an example: An elementary exercise from an algebra book asks you to prove that if a group G is finite, the number of elements not equal to their own inverse is even.
My attempt was: "Suppose $G$ is a finite group, and $S = \{x \in G : x \neq x^{-1}\}$. Suppose $x$ is an arbitrary element of $S$. Since $x \in G$, $\exists !y \in G(y = x^{-1})$. Suppose $y = x^{-1}$. Then we also have $x = y^{-1}$. But since $x \in S$, we know $x \neq y$, and therefore the inverse of $y$ is not equal to itself, hence $y$ is also in $S$. Since $x$ was arbitrary, we know every element of $S$ is 'paired' with another element of $S$. Since every element of a group can have only one inverse, we know that any for any two elements that are inverses of each other, neither can be an inverse of a third arbitrary element of S. Therefore the cardinality of $S$ is even."
However I am not confident in what I have written. In this specific example, the notion of being 'uniquely paired' seems completely vague to me, and I have no idea how to express this idea meaningfully in first order logic. This is although the statement is immediately obvious and intuitive in my head (which just tells me I am not good at writing such proofs). In this particular example, how can I justify what I have written down rigorously? It is also in this particular example that I would have no idea how to translate what I have written into any sort of formal proof, using rules of inference between each step.
More generally, how can a student learn to bridge the gap between the general 'proof exercises' encountered in proof books, and the more realistic theorems encountered in studying maths? Is it a useful benchmark to write out every proof in such a manner that it is at least somewhat clear how it could be transformed into a formal proof?