SPOILERLet's assume that (x,y,z) with x, y, z > 0 is the integer solution to the equation that MINIMIZES z then:
1. if GCD(x,y) = d != 1, then (x/d , y/d , z/d^2) is still an integer solution to the equation.
so GCD(x,y) = 1
2. (x^2, y^2, z) is a pythagorean triple, hence they exist a,b INTEGER with 0<b<a that satisfy x^2 = 2ab , y^2 = a^2 - b^2 , z = a^2 + b^2, with GCD(a,b) = 1 and a !≡ b (mod 2) (if a is even then b is odd and vice versa). If a is even, then b is odd, so y^2 ≡ a^2 - b^2 ≡ -1 ≡ 3 (mod 4) which is an absurd because a square is always ≡ 0 or 1 (mod 4)
so they exist a,b INTEGER with 0<b<a that satisfy x^2 = 2ab , y^2 = a^2 - b^2 , z = a^2 + b^2, with GCD(a,b) = 1, with a odd and b even
3. as seen on 2, (y,b,a) is a pythagorean triple
so they exist u, v INTEGER with 0<v<u that satisfy b = 2uv , y = u^2 - v^2, a = u^2 + v^2, with GCD(u,v) = 1, with u !≡ v (mod 2)
From 2 and 3, we have that
x^2 = 4uv(u^2 + v^2)
since GCD(u,v) = 1, GCD(u, u^2+v^2) = GCD(v, u^2+v^2) = 1 -> so u, v and u^2+v^2 are squares of integer numbers
u = p^2 , v = q^2 , u^2+v^2 = r^2
from this, we have that p^4 + q^4 = r^2
r <= r^2 = u^2+v^2 = a <= a^2 < a^2 + b^2 = z
we found a smaller solution, which contraddicts the underlined hypothesis in the first sentence.
QED