Here's a part of the definition Ross' Elementary Analysis states for limits of a function:
20.3 Definition
(a) For $a\in\mathbb R$ and a function $f$ we write $\lim_{x\to a} f(x)=L$ provided $\lim_{x\to a^S} f(x)=L$ for some set $S=J\setminus\{a\}$ where $J$ is an open interval containing $a$. $\lim_{x\to a} f(x)$ is called the [two-sided] limit of $f$ at $a$. Note $f$ need not be defined at $a$ and, even if $f$ is defined at $a$, the value $f(a)$ need not equal $\lim_{x\to a} f(x)$. In fact, $f(a)=\lim_{x\to a} f(x)$ if and only if $f$ is defined at $a$ and $f$ is continuous at $a$.
(b) For $a\in\mathbb R$ and a function $f$ we write $\lim_{x\to a^+} f(x)=L$ provided $\lim_{x\to a^S} f(x)=L$ for some open interval $S=(a,b)$. $\lim_{x\to a^+} f(x)$ is the right-hand limit of $f$ at $a$. Again $f$ need not be defined at $a$.
In both parts of the definition, why are open intervals needed? Would it fail if it were a closed interval instead?
Here are my opinions (Not accepted facts from math society):
Definitions usually should be short and provide good intuitive for incoming definitions.