The problem is: Prove that 7|x2+y2only if 7|x and 7|y for x,y∈Z

I found a theorem in my book that allows to do the following transformation: if a|band a|c-> a|(b+c)

So, can I prove it like this: 7|x2+y2=>7|x2,7|y2=>7|x∗x,7|y∗y=>7|x,7|y?

I am not really sure because I have this simple example in my head that even if 6|18 => 6|14+4 -> 6∤14 and 6∤4.

Any help will be appreciated, thank you!