Since , then for . Also, if is such a homomorphism, it must be that ,
where the product in the left side is modulo 7, whereas the sum in the right side is modulo 3.
But it must be .
From here you can now build your function taking into account, of course, that it must be since only are cubes in ...