I wish to find the limit of this function as $x \rightarrow \infty$.
$$f(x)=\left\{\begin{matrix} 1-\frac{1}{x} ~:\forall x \in \mathbb{Q}\\1 ~:\forall x \notin \mathbb{Q} \end{matrix}\right.$$
I have never had to find the limit of a function defined in pieces like this and wondered if it would be okay to bound the function below by $1-\frac{1}{x}$ and above by $1$ and then to just use the squeeze theorem to simply conclude the limit is $1$. I can't see any reason why this wouldn't work according to the theorem but the inclusion of the $\mathbb{Q}$ is making me a little unsure.