Checking local solubility of varieties at "bad" primes Let $X$ be a smooth variety defined over $\mathbb{Q}$. If we want to check that $X$ is locally soluble at a prime $p$, then it suffices to find a non-singular $\mathbb{F}_p$-point, which can be lifted to a $\mathbb{Q}_p$-point by Hensel's lemma.
However, it might happen that $X$ does not have any non-singular $\mathbb{F}_p$-points. For example $X$ could be given by a quadratic form and we are interested in the prime $p=2$, in which case the reduction mod $2$ of $X$ is a non-reduced scheme and hence every point is singular (at least if I understand the situation correctly).
What general methods are there, if any, to check local solubility in this kind of situation?
A nice toy example is the equation $x^2 + y^2 + z^2=0$. This is locally soluble for all primes $p \geq 3$ (by Chevalley–Warning) and clearly not soluble for $p=\infty$, hence it is not soluble at $p=2$ (by the Hilbert symbol formulation of quadratic reciprocity). Is there a simple way to see this using general methods?
 A: As mention in the comments by Pete Clark,  it is a theorem that when $n$ is sufficiently large, you will either be able to apply Hensel's Lemma to get a solution in the valuation ring, or you will find that there are no (primitive) solutions $\pmod{p^n}$.
In practice, I will assume your variety $X$ is affine and it is given as the zero set of some polynomials $f_1(x), \dots, f_m(x)$, where $x=(x_1,\dots,x_r)\in \mathbb{Z}_p[x_1,\dots,x_r]$, which you can assume is saturated, meaning that $$\left((f_1,\dots,f_m)\mathbb{Q}_p[x]\right)\cap \mathbb{Z}_p[x]=(f_1,\dots,f_m)\mathbb{Z}_p[x]$$
There is a procedure to saturate an ideal which essentially divides by $p$ a set of generators until is not possible to do it again, even making a linear combination of the generators.
If you have only one equation, which is the case one needs to have in mind, to be saturated means your coefficients are not all multiple of $p$.
If the reduction $\overline{X}$ modulo $p$ of $X$, i.e. given by the polynomials
$\overline{f_1}(x), \dots, \overline{f_m}(x)\in \mathbb{F}_p[x]$ contains a non singular point, then you are done by Hensel, so $X$ has a point over $\mathbb{Z}_p$.
If not, compute the $\mathbb{F}_p$-points, and for each $P=(a_1,\dots,a_r)\in \overline{X}(\mathbb{F}_p)$, consider the polynomials
$$f_{i,P}(x):=f_i(a_1+p\; x_1,\dots,a_r+p\; x_r)$$
(where I consider $a_i\in \mathbb{Z}$ given as $0\le a_i<p$). Saturate the ideal $I_P:=(f_{1,P}(x),\dots,f_{m,P}(x))$ and consider the scheme $X_P$ over $\mathbb{Z}_P$ given by that saturated ideal $\widetilde{I_P}$. Repeat the procedure. So, look at the $\mathbb{F}_p$-points of the reduction $\overline{X_P}$: if you find some non-singular point, this will lift to a point in $X_P$, so in $X$, whose reduction is $P$. If there are no points in $\overline{X_P}$, then $P$ does not lift to a point in $X$. If there are points, and all singular, we start again with $X_P$.
Let's do it in practice with your equation (which it can be proved also using Hilbert symbol). Here $f:=x_1^2+x_2^2+x_3^2$. Since we want to work in the affine setting (I guess you are considering the projective curve, since as affine variety we have the global point $(0,0,0)$), we take the affine patch "$x_3=1$", so we get $f:=x_1^2+x_2^2+1$. The reduction modulo $2$ has two points (in the affine space). I take $P=(1,0)$, but with the other will be analogous.
Then $$f_P:=(1+2x_1)^2+(2x_2)^2+1=2+4x_1+4x_1^2+4x_2^2$$
and we saturate (so we divide by 2) to get
$$\widetilde{f_P}:=1+2x_1+2x_1^2+2x_2^2$$
whose reduction modulo $2$ is $\widetilde{f_P}\equiv 1$, so it has no zeros. This is essentially showing that there is no solution modulo 4.
Consider another may be more interesting example, coming from famous Selmer example of a genus one curve having points locally but not globally. Take $f=3x^3+4y^3+5$ (this is an affine version of the curve), and consider $p=3$. It has three points in $\mathbb{F}_3$, namely $(0, 1), (1, 1), (2, 1)$, but all three are singular. Take $P=(0,1)$, and compute
$$f_P=3(3x)^3+4(1+3y)^3+5=9\left(9x^3 + 12y^3 + 12y^2 + 4y + 1\right)$$
whose saturation is $$\widetilde{f_P}=9x^3 + 12y^3 + 12y^2 + 4y + 1.$$ The reduction of the corresponding scheme $X_P$ is $\widetilde{f_P}\equiv y+1$, which has three points, all non-singular. Each one lifts to $\mathbb{Z}_3$ by Hensel. So the affine curve has points over $\mathbb{Q}_3$.
Magma software has this function implemented (see in here). I followed a bit the explanation given by Nils Bruin in "Some ternary Diophantine equations of signature (n, n, 2).", a chapter in W. Bosma and J. Cannon, editors, Discovering Mathematics with Magma. Springer-Verlag, Heidelberg, 2004, but the algorithm it is well known.
