When is the quadratic congruence $ax^2 + bx +c \equiv 0 \pmod p$ solvable? I am learning about quadratic congruences and I don't now how to decide, for which $a, b, c$ and $p$ there is a solution of the congruence. Is it sufficient if the discrminant $b^2-4ac$ has a solution in $\Bbb Z_p^*$?
 A: If $a = 0$, this reduces to a linear congruence which has a unique solution (provided $b \neq 0$); I assume you know how to find the solution in this case.
Now suppose $a \neq 0$.
If $\underline{p \neq 2}$, multiply the congruence by $4a$ to obtain $4a^2x^2 + 4abx + 4ac \equiv 0 \pmod p$. Completing the square gives $(2ax + b)^2 + 4ac - b^2 \equiv 0 \pmod p$. Now let $y = 2ax + b$, then the congruence becomes $y^2 \equiv b^2 - 4ac \pmod p$. Therefore the discriminant $b^2 - 4ac$ must be a square modulo $p$ (i.e. a square in $\mathbb{Z}_p$); we call such an element a quadratic residue modulo $p$. 
If $b^2 - 4ac$ is not a quadratic residue modulo $p$, then the congruence has no solutions. 
If $b^2 - 4ac$ is a quadratic residue modulo $p$, then there are two values of $y$, call them $y_1$, $y_2$, which solve $y^2 \equiv b^2 - 4ac$. Furthermore, these two values are negatives of each other, i.e. $y_2 = - y_1$. Note that it is possible that $y_1 = y_2$, namely when $b^2 - 4ac = 0$ in which case $y_1 = y_2 = 0$. For each value $y_i$, we obtain a value $x_i$ by solving the linear congruence $2ax_i + b \equiv y_i \pmod p$ which has a solution because $a \neq 0$. Note that $x_1$ and $x_2$ are distinct if and only if $y_1$ and $y_2$ are distinct.
In summary, the equivalence $ax^2 + bx + c \equiv 0 \pmod p$ has 
\begin{align*}
\text{no solutions}\ &\text{if}\ b^2 - 4ac\ \text{is not a quadratic residue}\\
\text{one solution}, x = 0\ &\text{if}\ b^2 - 4ac = 0\\
\text{two distinct solutions}\ &\text{if}\ b^2 - 4ac\ \text{is a non-zero quadratic residue modulo}\ p.
\end{align*}
The problem of determining whether or not $b^2 - 4ac$ is a quadratic residue modulo $p$ can be solved by using the law of quadratic reciprocity.
If $\underline{p = 2}$, then as $a \neq 0$, $a = 1$ so the congruence becomes $x^2 + bx + c \equiv 0 \pmod 2$. If $x = 0$, then we obtain the congruence $c \equiv 0 \pmod 2$; if $x = 1$, then we obtain the congruence $b + c \equiv 1 \pmod 2$. With these conditions at hand, we can determine the solutions for all four possible congruences: 
\begin{align*}
x^2 &\equiv 0 \pmod 2\ \text{has one solution,}\ x = 0\\
x^2 + 1 &\equiv 0 \pmod 2\ \text{has one solution,}\ x = 1\\
x^2 + x &\equiv 0 \pmod 2\ \text{has two solutions,}\ x= 0, 1\\
x^2 + x + 1 &\equiv 0 \pmod 2\ \text{has no solutions.}
\end{align*}
