Take any two rational numbers whose product is 2, and add 2 to each. The results are the legs of a right triangle with rational sides.
For example, 13/17 × 34/13 = 2. If we add 2 to each of these we get 47/17 and 60/13 or, clearing fractions, 611 and 1020. The hypotenuse is 1189.
Because (z + 2)2 + [(2/z) + 2]2 = [z + 2 + (2/z)]2, if z is rational, so are all three sides.
(R.S. Williamson, “A Formula for Rational Right-Angle Triangles,” Mathematical Gazette 37:322 [December 1953], 289-290, via Claudi Alsina and Roger B. Nelsen, Icons of Mathematics, 2011.)