Let $a$ be a given rational number. Write down the measurements of the sides of all "rational" right triangles (where the lengths of all sides are rational) for which the length of one of the legs is $a$.

If $a$ is an integer, find all "integer" - i.e., Pythagorean - triangles among them!
Let $b$ be the other leg, $c$ the measure of the hypotenuse, then we seek the solution of $c^{2}-b^{2}=a^{2}$ with rational $b$ and $c$. $a^{2}=(c+b) \cdot(c-b)$, here $c-b=\frac{p}{q}$ must be rational. Let this fraction be in its simplest form, that is, $p$ and $q$ are relatively prime numbers. From here, $c+b=\frac{a^{2} q}{p} \cdot b=\frac{\frac{a^{2} q}{p}-\frac{p}{q}}{2}=\frac{a^{2} q^{2}-p^{2}}{2 p q}, c=\frac{\frac{a^{2} q}{p}+\frac{p}{q}}{2}=\frac{a^{2} q^{2}+p^{2}}{2 p q}$. If $a$ is an integer and we are looking for the corresponding Pythagorean triples, then $2 p q$ must be a divisor of both numerators, and thus of their sum and difference: $2 a^{2} q^{2}$ and $2 p^{2}$. Since $p$ and $q$ are relatively prime, the latter is only possible if $q=1$, and the former if $p$ is a divisor of $a^{2}$. Then $a^{2}=p \cdot r, b=\frac{r-p}{2}, c=\frac{r+p}{2}$. The problem can only have solutions of this form, but the formulas do not always provide integer solutions. Only when the numerators are even, which follows if $r$ and $p$ are both odd or both even. (In short: $r$ and $p$ have the same parity.)

Solved by: Gacsályi S., Gehér L., Kővári T., Róna P., Vörös M.