why we require ƒ(x) be defined on an open interval about $x_0$? The definition of a limit in this book stated  like this 

1) why we require ƒ(x) be defined on an open interval about $x_0$ ?
2) does the definition mean it is impossible to talk about limit of function of this sort?
$f(x) = \begin{cases} undefined  & x \not\in \mathbb{Q}\\ 1 & x \in \mathbb{Q} \end{cases}$
Edit: Since some similar answers to my first question is that we want to talk about two-sided limit, thus require ƒ(x) be defined on an open interval about $x_0$. However, these answers doesn't clear my intended question. Now if I restrict $x>=1$, then can we talk about the limit of that function , especially for $\displaystyle \lim_{x \to 1^{+}}f(x)$?
As for my second question, I  found a more precise definition of limit in Courant's book Introduction_to_Calculus_and_Analysis stated like this 

which doesn't require  ƒ(x) to be defined on every point of the an open interval about $x_0$, so I think it is possible to talk about limit of that function.
 A: The idea of a limit of a function $f$ at a point $x_{0}$ is invented to give answer to the following question:
How does function $f$ behave near the point $x_{0}$?
Note that the question does not ask as to what happens at $x_{0}$ but rather what happens near $x_{0}$. Hence it does not matter whether $f$ is defined at $x_{0}$, but it does matter that $f$ is defined near $x_{0}$. Moreover we would like the function $f$ to be defined at points which are as close to $x_{0}$ as we want. The central idea is that the domain $D$ of $f$ need not contain point $x_{0}$, but it should contain points which are as near to $x_{0}$ as we please.
More formally, a basic prerequisite for defining limit of a function $f$ at a point $x_{0}$ is that for every real number $\delta > 0$ there must exist at least one point $x_{\delta}$ in the domain $D$ of $f$ such that $0 < |x_{\delta} - x_{0}| < \delta$.
When the condition mentioned in above paragraph holds we say that $x_{0}$ is a limit point (accumulation point, cluster point) of $D$.
In general setting the distance $|x_{\delta} - x_{0}|$ is replaced by a metric $d(x_{\delta}, x_{0})$ (which satisfies properties similar to the absolute value function).
For a beginner learning calculus it is better not to indulge in such generalities (of metric / topological spaces), but rather deal with the concrete spaces like set of real numbers. In that case we just say that $f$ needs to be defined in an interval which contains $x_{0}$ in the interior with the possibility that $f$ may not be defined at $x_{0}$.
Note that some authors prefer the general notion and define limits in the following manner.
Let $f: D\to \mathbb{R}$ be a function with $D\subseteq\mathbb{R}$ and let $x_{0}$ be any real number. A real number $L$ is said to be the limit of function $f$ at point $x_{0}$ (denoted by $L = \lim_{x \to x_{0}}f(x)$) if for any given number $\epsilon > 0$ it is possible to find a number $\delta > 0$ such that $|f(x) - L| < \epsilon$ for all points $x \in D$ with $0 < |x - x_{0}| < \delta$.
Based on this definition the limit of the function $f$ in your question is $1$.
The advantage of this definition over the usual one is that it deals with the left-hand and right-hand limits without any special treatment. However it is preferable to stick to the usual definition and define left-hand and right-hand limits separately (especially for a beginner).
A: Domain $f$ here is $\mathbb{Q}$, you can talk about limit of functon, and $\lim f=1$
A: (1) Because they want to approach $x_0$ from both sides.
(2) If you define $f:\mathbb Q \to \mathbb R$ by $f(x) = 1$ for all $x \in \mathbb Q$, then your definition of limit will not allow for $\displaystyle \lim_{x \to x_0}f(x)$ to exist. In topology, for example, the domain of the function is taken into account and, in that case $\displaystyle \lim_{x \to x_0}f(x)$ will be equal to $1$ for all rational $x_0$.
A: It certainly would be possible to define limits in a more general situation, provided that you're careful enough. The given definition has the advantage that you don't have to worry about the function being undefined, provided $\delta$ is small enough. If you wanted to be more general, you could drop the open interval requirement and stipulate that the $\epsilon$-$\delta$ condition is only required to hold at points where the function is defined. This would allow talking about limits in the function you specified. However, it is essential that limits cannot be defined at "isolated" points. For instance, if a function $f$ is defined only for $|x| \ge 1$ and $x=0$, then $\displaystyle\lim_{x\to0} f(x)$ makes no sense, but our modified definition would allow the limit to be anything! So we have to exclude isolated points, which would require defining precisely what an isolated point is. At the level of elementary calculus, this is starting to become overkill.
Thomas' definition of limit, together with "one-sided limits", covers all cases that actually occur in elementary one-variable calculus. Thus, there is not much reason to make things more complicated.
A: Suppose there is no open interval around $x_0$, where $f(x)$ is defined for all $x$ in that interval.
Which means for every $\delta >0$  $\exists x_1 \in (x_0-\delta,x_0+\delta)$ such that $f(x_1)$ is not defined. So we cannot say $|f(x)-L|<\epsilon$ $\forall x\in(x_0-\delta,x_0+\delta)$ , as you can not say anything about $|f(x_1)-L| $.
So the second condition can not be checked.
That is why it is in the definition.
