triangles in $\mathbb{R}^n$ with all vertices in $\mathbb{Q}^n$ In the context of this post, a triangle will mean a triple $(a,b,c)$ of positive real numbers which qualify as side lengths of a triangle (i.e., the triangle inequalities are satisfied).

Call triangle $(a,b,c)$ rationally realizable if, for some integer $n\ge 2$, a triangle with side lengths $a,b,c$ can be placed in $\mathbb{R}^n$ with all vertices in $\mathbb{Q}^n$.

Some examples . . .


*

*If equilateral triangle $(a,a,a)$ has $a\in\mathbb{Q}$, then it's rationally realizable in $\mathbb{R}^6$.$\\[6pt]$

Proof:$\;$Use vertices 
$
({\large{\frac{a}{2}}},{\large{\frac{a}{2}}},0,0,0,0),\,
(0,0,{\large{\frac{a}{2}}},{\large{\frac{a}{2}}},0,0),\,
(0,0,0,0,{\large{\frac{a}{2}}},{\large{\frac{a}{2}}})
$.

*If right triangle $(a,b,c)$ with legs $a,b$ has $a,b\in\mathbb{Q}$, then it's rationally realizable in $\mathbb{R^2}$.$\\[6pt]$

Proof:$\;$Use vertices $(0,0),\,(a,0),\,(0,b)$.



From the distance formula, for triangle $(a,b,c)$ to be rationally realizable, a necessary condition is $a^2,b^2,c^2\in \mathbb{Q}$. 

Is this condition also sufficient? More precisely:

Question:$\;$If triangle $(a,b,c)$ has $a^2,b^2,c^2\in \mathbb{Q}$, must it be rationally realizable?
 A: I have a positive answer if the triangle is not obtuse. Hopefully, the proof idea can be extended. 
First of all, by rescaling with some big positive integer, we may assume that $a^2, b^2, c^2$ are all even positive integers. So assume that the triangle is not obtuse, i.e., WLOG we have $a^2\leq b^2\leq c^2\leq a^2+b^2$. 
Let $n:= \frac{a^2+b^2+c^2}{2}$ be the dimension. Vertex $C$ is the origin. Vertex $B$ is the point whose FIRST $a^2$ coordinates are $1$ and the rest is $0$. The third vertex $A$ is the point whose LAST $b^2$ coordinates are $1$ and the rest is $0$.
Then the length of $BC$ is $a$, the length of $AC$ is $b$, and the length of $AB$ is $\sqrt{n-(a^2+b^2-n)}= \sqrt{2n-(a^2+b^2)}= c$. 
A: The answer is yes, and as quasi pointed out, it is also possible to solve the problem in at most 12 dimensions in the non-obtuse case. I will modify that construction, and provide the full proof in the obtuse case, which is more complicated. So WLOG assume that $a^2\leq b^2\leq c^2$ are all positive even integers. 
Case 1: The triangle is not obtuse, i.e., $c^2\leq a^2+b^2$. 
Let $s:= \frac{a^2+b^2-c^2}{2}\in \mathbb{N}$, and let $x:= b^2-s\in \mathbb{N}, y:= a^2-s\in \mathbb{N}$. 
By Lagrange's four-square theorem (see https://en.wikipedia.org/wiki/Lagrange%27s_four-square_theorem ), it is possible to write $x,y,s$ as the sum of squares of 4 integers. 
Produce vectors of length 4 out of these quartets of numbers, and denote them by $\underline{x}, \underline{y}, \underline{s}$, respectively. 
Let $C$ be the origin. Define $A,B$ as the concatenation of vectors of length four as follows: 
$$A=(\underline{x},\underline{s},\underline{0})$$
$$B=(\underline{0},\underline{s},\underline{y})$$ 
Then $\vert AB\vert=c$, $\vert BC\vert=a$, $\vert CA\vert=b$. 
Case 2: The triangle is obtuse,  i.e., $c^2> a^2+b^2$. We reduce this to the non-obtuse case. 
We pick positive rational numbers $x,y,z$ such that $c^2-z^2< (a^2-x^2)+(b^2-y^2)$, and $a_1:= \sqrt{a^2-x^2}, b_1:= \sqrt{b^2-y^2}, c_1:=\sqrt{c^2-z^2}$ are sides of a triangle in increasing order, and $x+y=z$. To find such rational numbers, we introduce the variable $\lambda>0$ and solve: 
$x=\lambda a$, $y=\lambda b$, $z=x+y$, and
$c^2-z^2= (a^2-x^2)+(b^2-y^2)$.
By substituting $z=x+y$ in the last equation we get: 
$$2xy= c^2-a^2-b^2= -2ab\cos \gamma$$ (Note that this is positive as the triangle is obtuse.) Putting $x=\lambda a$, $y=\lambda b$ yields the solution $\lambda= \sqrt{-\cos \gamma}$, which satisfies $0<\lambda<1$. 
As rational numbers are dense in the reals, we can pick rational numbers  $x\approx \lambda a, y\approx \lambda b, z:= x+y$, such that the equation is ruined in the right direction to obtain $c^2-z^2< (a^2-x^2)+(b^2-y^2)$. 
Now we can solve the problem using 13 coordinates. First, produce the solution in 12 coordinates for the triangle $(a_1, b_1, c_1)$. This is possible, as $a_1^2, b_1^2, c_1^2$ are rational and the triangle is acute, so we can refer to Case 1. The solution is $A_1, B_1, C_1$ where $C_1$ is the origin. 
We extend these solution vectors by a lucky thirteenth coordinate. In case of $C$, the new coordinate is also $0$, so $C$ is the origin in $\mathbb{R}^{13}$. 
In case of $A$, the new coordinate is $y$, and in case of $B$, the new coordinate is $-x$. Then $AC^2=b_1^2+y^2=b^2$, $BC^2=a_1^2+x^2=a^2$, and $AB^2=c_1^2+(x+y)^2= c_1^2+z^2= c^2$. 
Let me also point out that at least 4 dimensions is necessary in general, as there exist rational numbers that cannot be written as the sum of squares of three rational numbers. 
A: For the obtuse case, here's a geometric proof . . .

By A. Pongrácz's elegant construction, the claim holds for non-obtuse triangles.

We can reduce the obtuse case to the non-obtuse case as follows . . .

Suppose obtuse triangle $T$ has side lengths $a,b,c$, with $a\le b < c$, and $a^2,b^2,c^2\in\mathbb{Q}$.

Place a copy of triangle $T$ in $\mathbb{R^2}$ as triangle $ABC$, with $a=|BC|,\;b=|AC|,\;c=|AB|$.

Reflect $B$ (the vertex of the largest of the two acute angles) over $C$ to a point $C'$, and let $T'$ denote triangle $ABC'$.

By the formula for the length of a median

https://en.wikipedia.org/wiki/Median_(geometry)#Formulas_involving_the_medians%27_lengths

since the squared side lengths of triangle $T$ are rational, so are the squared side lengths of triangle $T'$.

In light of the midpoint formula, if triangle $T'$ is rationally realizable in $\mathbb{R}^n$ (for some integer $n\ge 2$), so is triangle $T$.

Hence, if $T'$ is non-obtuse, we're done.

Suppose $T'$ is obtuse.

The measure of angle at vertex $B$ is unchanged, so is still acute.

Let the side lengths of triangle $T'$ be $a',b',c'$, where $a'=|BC'|,\;b'=|AC'|,\;c'=|AB|$.

Then $a'=2a,\;c'=c$, and, by the median length formula, we get $(b')^2 = 2a^2+2b^2-c^2$.

Then identically,
$$(b')^2+(c')^2-(a')^2= (2a^2+2b^2-c^2)+(c^2)-(2a)^2=b^2-a^2$$
which is nonnegative, since $b\ge a$.

Thus, the new angle at $A$ (angle BAC') is non-obtuse, hence, since $T'$ is obtuse, the obtuse angle is at $C'$.

Consider the ratio of the new angle $A$ (angle $BAC'$), to the old one (angle $BAC$) . . .

Since angle $C'$ is obtuse, we have $|AB| > |AC'|$, hence, by the angle bisector theorem, 

https://en.wikipedia.org/wiki/Angle_bisector_theorem#Theorem

the angle bisector of angle $BAC'$ meets side $BC'$ strictly between $C$ and $C'$.

It follows that the new angle $A$, while still acute, is more than twice the old one.

In triangle $T'$, the new smallest angle is either angle $BAC'$ or angle $ABC'$.

Thus, either the new smallest angle is more than double the old one, or else the new smallest angle is equal to the larger of the two acute angles of the old one.

Now iterate the process, reflecting the vertex of the largest of the two acute angles of triangle $T'$ over $C'$ to a point $C''$, and let $T''$ denote triangle $ABC''$.

As before, if $T''$ is non-obtuse, we're done.

If not, the smallest angle of $T''$ is more than twice the smallest angle of $T$.

Thus, the process can't yield obtuse triangles forever, since, as long as the triangles are still obtuse, the smallest angle more than doubles after two iterations.

It follows that $T$ is rationally realizable.

This completes the proof.

Remark:$\;$With this approach, for the obtuse case, no extra coordinate is needed.
