C (gcc), 88 74 67 66 64 53 bytes
a,b;f(n){for(a=n;~a*n;b=b?--b:--a)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