Defining continuity in real analysis In real analysis, I am confused by the fact that I encounter at least 2 definitions of continuity of a function at a point.


*

*$\lim_{x\to{x_0}} f(x) = f(x_0)$

*$\forall{\epsilon>0} \: \exists{\delta>0} \: \forall x\in{Domain(f)} \: (|x-x_0| < \delta \rightarrow |f(x)-f(x_0)| < \epsilon)$


Only the second definition works for isolated points, but also does not require that the function be defined in an open interval containing $x_0$ (which implies, for example, that $\sqrt{x}$ is continuous at $x=0$). Is the second definition accurate?

More confusion comes from the fact that continuity in a closed interval $[a, b]$ is usually defined as the function being:


*

*right continuous at $a$

*continuous at all points of $(a, b)$

*left continuous at $b$


At the same time, one says that a function is continuous in a set of points if it is continuous at every point of that set. These two seem to contradict each other as intervals are just sets of points.

My intuitive idea about continuity doesn't help me answer whether $\sqrt{x}$ should be considered continuous at $x=0$. According to the topological definition of continuity, it should. The topological definition seems to contradict the closed interval definition.
Is there a way to reconcile all these?
 A: First, let's note that we can make the two definitions of continuity you have above agree, regardless if the domain of $f$ is an open subset of $\mathbb{R}$ or not. Indeed, consider generalizing the sequential definition:
Let $U \subset \mathbb{R}$, let $f : U \to \mathbb{R}$ be a function, and suppose $x_0 \in U$. Then $f$ is continuous at $x_0$ when for all sequences $\{x_n\}_{n=1}^{\infty}$ in $U \setminus \{x_0\}$ which converge to $x_0$ it holds that $\lim\limits_{n \to \infty} f(x_n) = f(x_0)$.
This definition agrees with the $\epsilon-\delta$ definition of continuity when the domain and codomain of $f$ are metric spaces. In particular, it works for isolated points, since if $\{x_0\}$ is isolated in $U$, then there are no sequences in $U \setminus\{x_0\}$ converging to $x_0$, so there's nothing to check. (This is a manifestation of the logic that anything we say about the elements in the empty set is true, since there are no elements in the empty set to check). Notice as well that this definition implies that $f(x) = \sqrt{x}$ is continuous at $0$ as a map $[0,\infty) \to \mathbb{R}$, since the only sequences $\{x_n\}_{n=1}^{\infty}$ in the domain $[0,\infty) \setminus \{0\} = (0,\infty)$ must converge to $0$ from the right, and hence $\sqrt{x_n}$ is defined and $\sqrt{x_n} \to 0 = \sqrt{0}$ as $n \to \infty$.
For right and left continuity, we can easily adjust the above definition as follows:
Let $U \subset \mathbb{R}$, let $f : U \to \mathbb{R}$ be a function, and suppose $x_0 \in U$. Then $f$ is right (resp. left) continuous at $x_0$ when for all sequences $\{x_n\}_{n=1}^{\infty}$ in $U \setminus \{x_0\}$ which converge to $x_0$ from the right (resp. left) it holds that $\lim\limits_{n \to \infty} f(x_n) = f(x_0)$.
As before, this definition works when the domain is an arbitrary subset of $\mathbb{R}$ (no need for the domain to be an interval); however, unlike the metric space generality we gained with definition for continuity above, the right and left continuity definition needs the ordering on $\mathbb{R}$ to make sense (how could we discuss a sequence converging from the right or left when there is no sense of left-to-right ordering that the number-line has?). The usefulness of considering continuity from the right/left at $x_0$, rather than simply continuity at $x_0$, typically occurs when there are sequences within the domain $U \setminus \{x_0\}$ converging to $x_0$ from both the right and left (such as when $x_0$ is an interior point of $U$), since then it could happen that the function is only right (or only left) continuous at $x_0$. Of course, if a function is continuous at a point from the right and from the left, then it is continuous there too. 
