Rational points on a sphere in $\mathbb{R}^d$
The question itself has already been answered. Let me just add that in case $d = 3$, one can obtain a nice picture by marking all rational points with height less than some upper bound, and projecting this to one of the coordinate planes. The following picture shows such projection of one octant of the sphere (bound on height: 2048):
This picture in resolution 2048 x 2048 pixels can be found at https://stefan-kohl.github.io/images/ratpoints2048.png.
Larger versions of this picture are available as well:
- 5000 x 5000 pixels, bound on height = 5000
- 10000 x 10000 pixels, bound on height = 10000
Projecting the rational points on the sphere in a Riemann-sphere-like way to the plane yields a picture like this:
The point where the sphere touches the plane is in the middle of the picture. One feature of the picture is a grid of white circles with mesh size 2, i.e. the diameter of the sphere. The higher density of points around the middle of the picture arises from the projection.
Larger versions of this picture are available as well:
- 5000 x 5000 pixels, bound on height = 5000, both coordinates from -6 to 6
- 10000 x 10000 pixels, bound on height = 10000, both coordinates from -8 to 8
Coincidentally, I learnt about the following paper (from 2008) by Erich Schmutz in a talk by Amos Nevo this morning which, I believe, answers both of your questions: Rational Points on the Unit Sphere.
In particular, he proves the following bound on the height of a rational point $r = (r_1, \ldots, r_d)$ on the unit sphere which is $\epsilon$-close to $x = (x_1, \ldots, x_d)$ for the sup-norm: $$H(r) \le \left( \frac {\sqrt{32} m} \epsilon \right)^{2 m},$$ where $m = \lceil \log_2 d \rceil$.
With regards to Q1 you can get a finer notion of density by counting the number $N(B)$, say, of rational points with height at most $B$, and consider how this quantity behaves as $B\rightarrow \infty$. I would think of this problem projectively. In this case rational points would be $[x_1,\dots,x_n,y]$, with $x_1,\dots,x_n,y$ integers such that $\gcd(x_1,\dots,x_n,y)=1$, for which $$ x_1^2+\cdots +x_d^2=y^2.$$ One could then define the height of a point to be $\max(|x_i|,|y|)$. Using the Hardy-Littlewood circle method, for example, one can prove (for $d\geq 3$) that $$ N(B)\sim B^{d-1}\sigma_\infty\prod_p\sigma_p, $$ as $B\rightarrow \infty$, where $\sigma_v$ is the density of points on the quadric in the completion $\mathbb{Q}_v$.