I'm not sure the proof is right. Also, I tried to justify the different ways p can be expressed with the Quotient Remainder Theorem, but not sure it is that or by the Division Algorithm. Are they the same or is there enough difference to make the proof wrong.
If p>=5 is a prime number, then p^2 +2 is composite.
Proof: Suppose p>=5 is a prime number. Then by the quotient remainder theorem, p can be expressed as
6m or 6m + 1 or 6m + 3 or 6m + 4 or 6m + 5 for some integer m.
However, since p is a prime number greater than or equal to 5, it cannot be expressed as a multiple of 2 or 3.Thus p can only be expressed as
6m+1 or 6m+5.
If p = 6m + 1, then by squaring p and adding 2, we get
p^2 + 2 = (6m+1)^2 + 2 = 3(12m^2 + 4m +1)
Thus p^2 + 2 is divisible by a number less than p^2 + 2 and greater than 1, so, p^2 + 2 is composite.
If p = 6m + 5, then by similar reasoning we get
p^2 + 2 = (6m+5)^2 + 2 = 3(12m^2 + 20m +7)
Thus p^2 + 2 is divisible by a number less than p^2 + 2 and greater than 1, so, p^2 + 2 is composite. Hence, in either case p^2 + 2 is composite, which is what we needed to show.