why we use open interval in epsilon delta definition fot domain of function? In epsilon delta definition of limit we see : "Let f be a function defined on some open interval" .
why we use open interval ?
what happen if we use closed interval in definition ?
thanks a lot.
 A: Here is an example of the difference. I assume you are referring to the definition

Let $f$ be defined on some open interval $(a,b)$ and $x_0 \in (a,b)$. Then $$\lim_{x \to x_0} f(x) = L$$ if and only if for every $\epsilon > 0$, there exists some $\delta > 0$ such that if $x \in (a,b)$ and $0<|x - x_0|<\delta$, then $|f(x) - L| < \epsilon$.

The requirement that $x \in (a,b)$ is needed because if $\delta$ is large enough, $|x - x_0| < \delta$ may include $x$ not in $(a,b)$, and therefore potentially for which $f(x)$ is not defined.
You are asking about changing it to

Let $f$ be defined on some closed interval $[a,b]$ and $x_0 \in [a,b]$. Then $$\lim_{x \to x_0} f(x) = L$$ if and only if for every $\epsilon > 0$, there exists some $\delta > 0$ such that if $x \in [a,b]$ and $0<|x - x_0|<\delta$, then $|f(x) - L| < \epsilon$.

Note that saying "$f$ is defined on an interval" does not preclude $f$ also being defined outside that interval. It may be defined, or it may not. Consider the Heaviside function
$$H(x) = \begin{cases}0&x < 0\\1&0 \le x\end{cases}.$$
This is defined on each of the intervals $(-1,1)$, $[-1,1]$, and $[0,1]$, and $x_0 = 0$ is a point in both intervals.

*

*Using the open interval definition with $(-1,1)$ and $\epsilon <
   \frac 12$, we see that there is no $\delta$ that works. The limit of
$H(x)$ as $x \to 0$ does not converge.

*Using the closed interval definition with $[-1,1]$ and $\epsilon <
   \frac 12$, we see again that there is no $\delta$ that works. The
limit does not converge.

*But using the closed interval definition with $[0,1]$, and any
$\epsilon > 0$, just the requirement $x \in [0,1]$ is enough to ensure $|H(x) - 1| = 0 < \epsilon$, regardless of what $\delta$ we pick. Thus under this definition, and this particular closed interval, $\lim_{x \to x_0} H(x)$ converges to $1$.

You see the problem? The closed interval definition depends on the particular closed interval chosen. But you can show that the open interval version does not. If $(a,b)$ and $(c,d)$ are two open intervals with $x_0$ in both and $f$ defined on both. Then you will get the same limit behavior if you use $(c,d)$ as the interval as you did using $(a,b)$ as the interval. The limits for the two intervals will converge or diverge together, and if they converge, it will always be to the same value.
Given that the author is defining a two-sided limit here, the assumption that $f$ is defined on an open interval assures that $f$ is defined on both sides of $x_0$, and the values of $f$ on both sides must approach the limit. If you use closed intervals instead, you risk $f$ only approaching the limit on one side of $x_0$, and either not being defined, or doing something completely different on the other side.
Of course, there are also one-sided limits, where you specifically want exactly that. But that is not what is being defined at this time. The authors are starting with the most simple case first, and will define other cases in the future, once two-sided limits have been mastered.
A: If a function is defined on a interval that is not open (nor closed) you can get some curious functions that are still continuous.  For example: Let $$ f(x)  = \left\{
        \begin{array}{ll}
            1 & \quad n \textrm{  odd} \\
            2 & \quad \textrm{otherwise} 
        \end{array}
    \right. $$
where the domain of $f$ is $ D=\{ \frac{n}{n+1}\}$ for all $n \in \mathbb{N}$.  This function is continuous on $D$ but not continuous on $\overline{D}$ for any value of $f$.  Put another way, continuous functions are better behaved on sets that contain at least some of their limit points, like open sets.
