using Euclid's lemma in mod proof 
a) Use Euclid’s Lemma to show that for every odd prime $p$ and every 
  integer $a$, if $a \not\equiv 0 \pmod p$, then
      $$x^2 \equiv a \pmod p$$
  has $0$ or $2$ solutions modulo $p$. 
b) Generalize this in the following way: 
Let $m = p_1\cdots p_r$ with distinct odd primes $p_1,\dots, p_r$ and let $a$ be an integer with 
  $\gcd(a, m) = 1$. Show that $$x^2 ≡ a \pmod m$$ has either $0$ or $2^r$ solutions modulo $m$.

My attempt at part a is as follows:
suppose $$x^2 ≡ a \pmod p$$ $$y^2 ≡ a \pmod p$$
Then $$x^2 ≡ y^2 \pmod p$$ $$x^2 - y^2 ≡ 0 \pmod p$$ $$(x+y)(x-y)≡ 0 \pmod p$$
So now using Euclid's lemma $p \mid (x+y)$ or $p\mid(x-y)$, hence $y ≡ x \pmod p$ or $y ≡ -x \pmod p$
This would mean the two solutions would be $x$ and $-x$ but I'm not sure how to prove that there must be exactly 2 or exactly 0 solutions.
Is it sufficient to say that if $x^2 ≡ a \pmod p$ then $(-x^2) ≡ a \pmod p$?
Is it also true and since $x \neq-x$ then there must be two solutions? That also doesn't cover the case of 0 solutions.

Your proof for (a) is essentially correct. It can be shortened by observing that $\mathbb{Z}/p\mathbb{Z}$ is a field, so a degree two equation has at most two solutions. Since $p$ is an odd prime, the existence of a solution implies that also its negative is a distinct solution. So either no solution or two.
For (b), you can use the fact that the Chinese remainder theorem proves that the map
$$\newcommand\Z[2][]{\mathbb{Z}/#2_{#1}\mathbb{Z}}
\varphi\colon\Z{m}\to
\Z[1]{p}\times\Z[2]{p}\times\dots\times\Z[r]{p}
\qquad
[x]_m\mapsto\bigl([x]_{p_1},[x]_{p_2},\dots,[x]_{p_r}\bigr)
$$
is a ring isomorphism (where $[x]_n=x+n\mathbb{Z}$).
Thus the existence of a solution for $[x^2]_m=[a]_m$ implies, via projections the existence of a solution for $[x^2]_{p_i}=[a]_{p_i}$ ($i=1,2,\dots,r$).
Conversely, if $[x_i]_{p_i}$ is a solution for $[x^2]_{p_i}=[a]_{p_i}$ in $\Z[i]{p}$, for $i=1,2,\dots,r$, then
$$
\varphi^{-1}\bigl([x_1]_{p_1},[x_2]_{p_2},\dots,[x_r]_{p_r}\bigr)
$$
is a solution for $[x^2]_m=[a]_m$. Hence either there is no solution (because $[x^2]_{p_i}=[a]_{p_i}$ has none for at least one $i$), or we have $2^r$ solutions, by choosing one among the two in each component.
