Let x be any integer
Then,
Either x=5m or x=5m+1 or x=5m+2 or, x=5m+3 or x=5m+4 for integer x. [ Using division algorithm]
If x=5m
On squaring both side and we get,
x2=25m2=5(5m2)=5n where n=5m2
If x=5m+1
On squaring both side and we get,
x2=(5m+1)2
=25m2+1+10m
=5(5m2+2m)+1(where5m2+2m=n)
=5n+1
If x=5m+2
Then x2
=(5m+2)2
=25m2+20m+4
=5(5m2+4m)+4
=5n+4 [ Taking n=5m2+4m]
If x=5m+3
Then x2
=(5m+3)2
=25m2+30m+9
=5(5m2+6m+1)+4
=5n+4 [ Taking n=5m2+6m+1]
If x=5m+4
On squaring both side and we get,
x2=(5m+4)2
=25m2+16+40m
=5(5m2+8m+3)+1(where5m2+8m+3=n)
=5n+1
Hence, In each cases x2 is either of the of the form 5n or 5n+1 for integer n..