Specialmom brings up a good point. IF this is also happening at school, then it is not just what is going on at home. 7 is an age where kids want to please people. If they are not doing work at school and at home, etc. Then there is a reason why. And that reason is either an un-diagnosed learning disability or something like ADHD or ADD which is causing the child anxiety and basically giving up.
Before this school year ends, talk with his teacher! The school can help. I am also the CL on the adhd forum and have tons of info on that if you need it. But, if you can find out what the problem is....there are ways to deal with it.
Perhaps check out this link and see if any of it rings a bell.
https://helpguide.org/articles/add-adhd/attention-deficit-disorder-adhd-in-children.htm
Parenting is a hard gig. So, what have you tried? This happens at school and at home both? Are there any suggestions of things like ADD/ADHD for him?