I hate when people casually move "between" Q and Z as if a rational number with unit denominator suddenly becomes an integer, and it's all because of this terrible "a/b" notation. It's more like (a, b). You can't ever discard that second component, it's always there. ;)
Yes, you're right. You can't say your function operates in Z "but has solutions in Q". That's what people are doing when they take a real function and go "ooh look, secret complex solutions!"