Using the following dissection and the fact that the number of lattice points on a line between (0,0) and (a,b) for integer a,b is gcd(a,b) (https://math.stackexchange.com/questions/628117/how-to-count-lattice-points-on-a-line if you need to see more), it is fairly simple to see that the number of interior points in the internal square is I = (a+b+1)^2 - 2ab - 2(a+b+gcd(a,b)) and that the number of boundary points is B=4gcd(a,b). This formula for I comes from subtracting the total number of lattice points in the small triangles from the number of lattice points in the bigger square.
But then using Pick's theorem again with our formulas for I and B and doing basic algebra gives A=a^2 + b^2. Or, c^2 = a^2 + b^2.
This only works for integer values of a and b but is this valid? Also does it only work for half/integer or integer values of c^2 since pick's theorem shows that area can only be a half integer or integer (and the resulting endpoints of the c square side will not be at integer coordinates) ?
reaction for more information.