We identify the real number 2 with the rational number 2 with the integer 2 with the natural number 2. It does not seem so strange to also identify the complex number 2 with those.

If you say "this function f operates on the integers", you can't turn around and then go "ooh but it has solutions in the rationals!" No it doesn't, it doesn't exist in that space.

You can't do this for general functions, but it's fine to do in cases where the definition of f naturally embeds into the rationals. For example, a polynomial over Z is also a polynomial over Q or C.