In general, when working in constructive mathematics, the only time you would be able to provestrategy for proving $P \to (Q \lor R)$ constructively$Q \lor R$ is if you couldto prove $P \to Q$$Q$ or to prove $P \to R$$R$. In this case, neither of those latter implications holds, sojust knowing abstractly that "there is an $n \not = 1$ that divides both $a$ and $b$" does not directly tell you won't findwhether $b$ is composite or whether $b$ divides $a$. So you will need more information to come up with a constructive proof.
If you know more than the fact that only usesthere is such an $n$, and you actually know the value of $n$, that would help. In particular, if you could tell whether your value of $n$ is equal to $b$, then you can tell which side of the disjunction holds. So we could use the fact $(\forall k)[k = b \lor k \not = b]$ to finish the constructive logic with no additional factsproof.
However, manyMany real-world constructive systems include additional facts like that about the natural numbers, which would not be true for other objects. In particular, such asmany constructive systems prove the sentence $(\forall n,m \in \mathbb{N})[n = m \lor n \not = m]$, which says the natural numbers have decidable equality. The motivation for accepting this in constructive systems is that, given two concrete (terms for) natural numbers, we could in principle examine them to see if they are equal. This is not the case for other objects, such as real numbers, for which equality is not decidable. The fact that equality of natural numbers is decidable is provable, in many systems of constructive math, from induction axioms that are already included.
So, withWith a little work, these constructive systems prove that each natural number is either composite or not composite. WithAnd, with that extra fact, the remainder of the original proof goes through constructively. This may be out of the scope of an introductory proofs class, but it is one way a constructivist could prove the result.