C (gcc), 88 74 67 66 6464 53 bytes
a,b,g;fb;f(n){for(g=a=n;~a*g;aa=n;~a*n;b=b?--)for(b=n;~b*g;bb:--a)g=a*a+b*b-n;g=g;n*=a*a+b*b!=n;a=n;}
-14 bytes - thanks to Kevin Cruijssen
-7 bytes - by omitting return (using global variable)
-1 byte - by using -
instead of !=
-2 bytes - thanks to AZTECCO
-11 bytes - thanks to AZTECCO x2