Number theory and divisibility proof If a|b and a|b+2, how do I prove that a must be either a=2, or a=1?

I know that $b=aq$ and $b+2=ap$. 
$aq+2=ap$ 
And now I don't know what to do with it.
 A: If $a|b$ and $a|b+2$, then $a|(b+2) - b$. This is because 
$$\begin{align}&b=ap, b+2= aq\\
\implies &(b+2)-b= a(p-q) \\
\implies &a|(b+2)-b\end{align}$$
The last line is true because dividing both sides by $a$ will yield an integer.
Since $(b+2)-b=2$, we have $a| 2$. So we have $a=\pm 1, \pm 2$.
A: By the usual algebra of divisibility, $a$ must also divide $\gcd(b, b+2)$, which is pretty easy to simplify.
But if we go with your approach, the most obvious thing to do with your equation is to try and collect terms to simplify:
$$ a(q-p) + 2 = 0$$
or maybe it's easier to understand as
$$ a(p-q) = 2 $$
There aren't many possibilities for the value of $a$! (or for $p-q$). You can simply try each one individually.

But as I often like to point out, questions of divisibility are often easier to understand using modular arithmetic. You are given
$$ b \equiv 0 \pmod a$$
$$ b +2 \equiv 0 \pmod a $$
Eliminating $b$ by plugging the first equation in to the second gives
$$ 2 \equiv 0 \pmod a$$
which again sharply limits the possibilities for $a$. Maybe you want to convert back to divisibility at this point.
This is ultimately essentially the same derivation as your observation together with my suggestion of how to continue -- but in my opinion, approaching the problem this way is not only simpler, but makes it easier to see what things are useful to try to do.
