Let $P(x)$ be some predicate where $x$ belongs to some set, say the real numbers for convenience.
Then consider the following three predicates:
\begin{gather} R(x) ::= \forall x \in \mathbb{Z}, P(x) \\ S(x) ::= \forall x \in \mathbb{Q}, P(x) \\ T(x) ::= \forall x \in \mathbb{R}, P(x) \\ \end{gather}
Can we define a $P(x)$ such that $R(x)$ and $T(x)$ are true but $S(x)$ is false?
We can certainly define $P(x)$ in a way that none of $R(x), S(x)$ and $T(x)$ are true. (For example, $P(x)::= (x = 0) \ \land \ (x = 1) $).
Likewise, we can set $P(x)::= 2x \not = 1$ so that $R(x)$ is true but the other two are false.
Or we can define $P(x)::= \exists x \ \text{s.t.} \ 2x+1 = 0$ so that $R(x)$ is false but $S(x)$ and $T(x)$ are true.
However, I couldn't think of a definition for $P(x)$ which is true for $R(x)$ and $T(x)$ but not for $S(x)$. Which made me think that it might not be possible, in which case would it be possible to prove it?
I'm not sure if I'm too late, but I'll try to keep it as simple as possible.
I am going to assume that $\mathbb{Q}$ is a subset of $\mathbb{R}$. In other words, I know that $\forall x(x\in\mathbb{Q}\implies x\in\mathbb{R})$.
You want to know if a statement $P(x)$ exists, such that it is true for all real numbers and integers, but not for all rational numbers. More formally, you want to know the true-or-false value of the following second-order statement:
$\exists P(\forall x\in\mathbb{R}:P(x)\land\neg\forall x\in\mathbb{Q}:P(x)\land\forall x\in\mathbb{Z}:P(x))$
We are trying to prove that the above statement is false, rather than true. We can do this by making implications until we arrive at a false conclusion, which would tell us that, since it lead us to a false conclusion, the original statement itself must also be false. I tried to be as clear as possible in this step, but if you still have trouble understanding it, let me know in the comments.
Trivially, if the above statement is true, then:
$\exists P(\forall x\in\mathbb{R}:P(x)\land\neg\forall x\in\mathbb{Q}:P(x))$
is also true. We can rewrite the above statement in the following form:
$\exists P(\forall x\in\mathbb{R}:P(x)\land\exists x\in\mathbb{Q}:\neg P(x))$
Since $\mathbb{Q}$ is a subset of $\mathbb{R}$, as stated above, then the above statement implies that:
$\exists P(\forall x\in\mathbb{R}:P(x)\land\exists x\in\mathbb{R}:\neg P(x))$
Let's rewrite the second half of the statement as a negation once again:
$\exists P(\forall x\in\mathbb{R}:P(x)\land\neg\forall x\in\mathbb{R}:P(x))$
The above can be reached with only one implication instead of four, but I felt the implication involving $\mathbb{Q}$ and $\mathbb{R}$ might be easier to grasp this way.
Just in case you didn't notice that the proof is already over, I'll add a few extra brackets for you:
$( \forall x\in\mathbb{R}:P(x) ) \land\neg ( \forall x\in\mathbb{R}:P(x) )$
The above statement states that the statement regarding $P(x)$ and its negation are both true, which is impossible, so the above statement is ultimately false.
As you can see, the proof is actually rather trivial. It is possible that you are not quite accustomed with first-order logic/proofs in general, in which case I hope my explanations werea little helpful. If you're still unclear, feel free to ask more questions in the comments.