Let $S_n$ be an $n \times n$ square of lattice points in $\mathbb{Z}^2$.
Q1. What is the largest subset $A(n)$ of lattice points in $S_n$ that have the property that every pair of points in $A(n)$ are separated by an integer Euclidean distance?
Is it simply that $|A(n)| = n$? And similarly in $\mathbb{Z}^d$ for $d>2$?
$5 \times 5$ lattice square, $5$ collinear points.
Q2. What is the largest subset $B(n)$ of lattice points in $S_n$, not all collinear, that have the property that every pair of points in $B(n)$ are separated by an integer Euclidean distance?
$5 \times 5$ lattice square, $4$ noncollinear points.
A $9 \times 9$ example with $5$ noncollinear points, also based on $3{-}4{-}5$ right triangles, is illustrated in the Wikipedia article Erdős–Diophantine graph.