Example 2 Find all such prime numbers that are both the sum of two prime numbers and the difference of two prime numbers.
Analysis Consider the prime number 2, which is the only even number among primes.
Solution Let the prime number sought be $p$. Since it is the sum of two primes, $p>2$.
Thus, $p$ is odd, so one of the two primes that sum to $p$ must be 2.
At the same time, in the two primes with a difference of $p$, the subtrahend is also 2, i.e., $p=q+2, p=r-2$, where $q, r$ are primes.
Thus, $p-2, p, p+2$ are all primes.
And $p-2, p, p+2$ are three consecutive odd numbers, one of which must be a multiple of 3.
Since this number is a prime, it can only be 3.
Upon inspection, only when $p-2=3, p=5, p+2=7$, does it satisfy the conditions, hence $p=5$.