By Euclid's division algorithm , a=bq+r where a,b,q,r are non-negative integers and 0≤r<b.
On putting b=4 we get
a=4q+r ....(i)
When r=0,a=4q
Squaring both sides, we get
a2=(4q)2
=4(4q2)
=4m is perfect square for m=4q2
When r=1,a=4q+1
Squaring both sides, we get
a2=(4q+1)2
=(4q)2+(1)2+2(4q)
=4(4q2+2q)+1
=4m+1 is perfect square for m=4q2+2q
When r=2,a=4q+2
Squaring both sides, we get
a2=(4q+2)2
=(4q)2+(2)2+2(4q)(2)
=4(4q2+4q+1)
=4m is perfect square for m=4q2+4q+1
When r=3,a=4q+3
Squaring both sides, we get
a2=(4q+3)2
=(4q)2+(3)2+2(4q)(3)
=16q2+9+24q
=16q2+24q+8+1
=4(4q26q+2)+1
=4m+1 is perfect square for some value of m.
Hence, the square on any integer is either of the form 4q or (4q+1) for some integer q.