To solve questions like these in general, it may help to reverse engineer the proof. Suppose we had a proof of $\vdash p \Rightarrow \lnot \lnot p$. There must be a first such occurrence of $p \Rightarrow \lnot \lnot p$ within the proof.
Notice that this first such occurrence cannot be in the conclusion of a modus ponens application. This is because if modus ponens was applied on $\{A, A \Rightarrow B\}$ to infer the conclusion $B$ and if the $B$ contains an occurrence of $p \Rightarrow \lnot \lnot p$, then another occurrence must also occur in the RHS of the premise $A \Rightarrow B$.
Therefore, the first such occurrence of $p \Rightarrow \lnot \lnot p$ must be the rightmost subexpression from an axiom. Here are the forms of all viable candidates:
- From the first axiom schema $A \Rightarrow (B \Rightarrow A)$, they are:
- $\lnot \lnot p \Rightarrow (p \Rightarrow \lnot \lnot p)$
- $(p \Rightarrow \lnot \lnot ~p) \Rightarrow (B \Rightarrow (p \Rightarrow \lnot \lnot ~p))$
- From the second axiom schema $[A \Rightarrow (B \Rightarrow C)] \Rightarrow [(A \Rightarrow B) \Rightarrow (A \Rightarrow C)]$, they are:
- $[p \Rightarrow (B \Rightarrow \lnot \lnot p)] \Rightarrow [(p \Rightarrow B) \Rightarrow (p \Rightarrow \lnot \lnot p)]$
- $[A \Rightarrow (B \Rightarrow (p \Rightarrow \lnot \lnot p))] \Rightarrow [(A \Rightarrow B) \Rightarrow (A \Rightarrow (p \Rightarrow \lnot \lnot p))]$
- From the third axiom schema $\lnot \lnot A \Rightarrow A$, it is:
- $\lnot \lnot (p \Rightarrow \lnot \lnot ~p) \Rightarrow (p \Rightarrow \lnot \lnot ~p)$
(Note: For the sake of clarity, I used the letters $A$, $B$, and $C$ to denote arbitrary formulas.)
Now, which one of these are actually useful to include in the proof? Since the premise of (1) is logically invalid, it cannot be that. Since using modus ponens on (2) would require that $p \Rightarrow \lnot \lnot p$ was a premise, it cannot be that.
Since the premise of (4) and the premise of (5) both include $p \Rightarrow \lnot \lnot p$ as a subexpression, I would not recommend trying those candidates first.
Thus, as a hint, try to include candidate (3).