First, we need a rational function whose limit at infinity is a real number. This means that the degree of the bottom is greater than or equal to the degree of the top. There are two cases: the denominator has higher degree than the numerator, or the denominator has the same degree as the numerator.
If the denominator has higher degree than the numerator, then x→∞limf(x)=x→−∞limf(x)=0, so the limits are equal–not what we're looking for.
If the denominator has the same degree as the numerator, then the limit as x goes to ±∞ is the ratio of the leading terms: again, the limits are equal. So no rational function exists as described.