I was asked to give an example of a proposition with a quantifier which is true if the quantifier ranges over the integers, but false if it ranges over the rational numbers.
My attempt:
$$(\exists n \in \mathbb{Z}, 2n =n^2)$$
Is this the correct approach?
One way is to find an expression that gives different values for integers than non-integers.
An obvious candidate is $\lfloor x \rfloor$, the integer part of $x$. This is $x$ when $x$ is an integer and less than $x$ otherwise.
Therefore one proposition that works is $P(x) \equiv (x = \lfloor x \rfloor)$.