7. By symmetry, without loss of generality, assume x⩾y⩾z⩾0. From (x+y)+z=2×21, we know that x+y,21,z form an arithmetic sequence. Hence, let x+y=21+d,z=21−d. From x+y⩾2z, we get 61⩽d⩽21, then xy+yz+zx−2xyz=(x+y)z+xy(1−2z)=41−d2+2dxy⩾0. The equality holds if and only if x=1,y=z=0.
Also, 41−d2+2dxy⩽41−d2+2d(2x+y)2=41−d2+21d(21+d)2=41+41×2d(21−d)2⩽41+41[32d+(21−d)+(21−d)]3=41+41×271=277.
The equality holds if and only if x=y=z=31. Therefore, 0⩽xy+yz+zx−2xyz⩽277.