Here are a couple of ways to prove $P \Rightarrow P$.
- Use a truth table:
The proof that this statement is a tautology comes from the column in red: all rows in that column are true.
- Use a derivation system with inference rules:
There are two inference rules used in this Fitch-style proof checker after an assumption is made on line 1. One is called reiteration (R) where a statement that one already accepts may be used again. The second rule is conditional introduction (→I). This rule summarizes the subproof on lines 2 and 3: if I assume $P$ is true then any line correctly derived after that can be used as a conclusion. It is also called the deduction theorem.
Here is the OP's question:
But, I'm wandering if this is proving something? Or it just only shows how to apply the law of excluded middle?
In the truth table one can see that any statement $P$ can have one of two truth values, true or false. That would be the principle of bivalence. The law of excluded middle claims that any statement $P$ is either true or $\lnot P$ is true which would be useful in a derivation.
The derivation doesn't use the law of excluded middle as an inference rule to derive $P \Rightarrow P$. Admittedly, this derived conditional doesn't show much. However, one can look at $P$ as the common ground for two people engaging in an argument. After arguing they may be no further than $P$. Then all they can claim is $P \Rightarrow P$.
Michael Rieppel Truth Table Generator https://mrieppel.net/prog/truthtable.html