Answer: I counted 36.
(edit) But the answer is 40.
Explanation:
Count all the "normal" squares. 16.
Then all the 2x2 normal squares. 9.
Then count all the tiny squares. 8.
Then the 2 big squares the tiny squares make. 2.
Then the giant square, which is all the squares. 1.
And I agree this probably is a trick question.
16 + 9 + 8 + 2 + 1 = 36 squares in total
*EDIT*
Apparently 3x3 squares exist so...
3x3 squares . 4
so 36 + 4 = 40 squares in total
(thanks to the person who asked the question in the first place for telling me about those 3x3 squares)