[proofplan]
We prove the ordinary relative $\varepsilon$-$\delta$ condition for continuity at $a$. Given an error tolerance $\varepsilon > 0$, left continuity supplies a radius that controls $f(x)$ for points of $E$ lying on the left of $a$, while right continuity supplies a radius that controls $f(x)$ for points of $E$ lying on the right of $a$. Taking the smaller of these two radii gives a single neighbourhood of $a$ in $E$, and every point in that neighbourhood falls into one of the two one-sided cases.
[/proofplan]
[step:Choose a common radius from the one-sided continuity hypotheses]
Fix $\varepsilon > 0$. By left continuity of $f$ at $a$ relative to $E$, there exists a number $\delta_- > 0$ such that for every $x \in E$ satisfying $x \le a$ and $|x-a| < \delta_-$, we have
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
By right continuity of $f$ at $a$ relative to $E$, there exists a number $\delta_+ > 0$ such that for every $x \in E$ satisfying $x \ge a$ and $|x-a| < \delta_+$, we have
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
Define the common radius $\delta > 0$ by
\begin{align*}
\delta := \min\{\delta_-,\delta_+\}.
\end{align*}
Since $\delta_- > 0$ and $\delta_+ > 0$, the minimum $\delta$ is positive.
[/step]
[step:Apply the appropriate one-sided estimate to every nearby point of $E$]
Let $x \in E$ satisfy $|x-a| < \delta$. Since $x,a \in \mathbb R$, either $x \le a$ or $x \ge a$.
If $x \le a$, then $\delta \le \delta_-$ gives $|x-a| < \delta_-$, so the left continuity estimate yields
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
If $x \ge a$, then $\delta \le \delta_+$ gives $|x-a| < \delta_+$, so the right continuity estimate yields
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
Thus for every $x \in E$ with $|x-a| < \delta$, one has $|f(x)-f(a)| < \varepsilon$.
[guided]
We must prove continuity at $a$ relative to the domain $E$. That means: for the fixed number $\varepsilon > 0$, we need one radius $\delta > 0$ that works for all points $x \in E$ with $|x-a| < \delta$, regardless of whether those points approach $a$ from the left or from the right.
The hypotheses give two radii, not one. Left continuity gives a number $\delta_- > 0$ such that whenever $x \in E$, $x \le a$, and $|x-a| < \delta_-$, we have
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
Right continuity gives a number $\delta_+ > 0$ such that whenever $x \in E$, $x \ge a$, and $|x-a| < \delta_+$, we have
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
To make one radius that is compatible with both estimates, define
\begin{align*}
\delta := \min\{\delta_-,\delta_+\}.
\end{align*}
This number is positive because both $\delta_-$ and $\delta_+$ are positive. It also satisfies $\delta \le \delta_-$ and $\delta \le \delta_+$.
Now take any $x \in E$ with $|x-a| < \delta$. Since the [real numbers](/page/Real%20Numbers) are linearly ordered, either $x \le a$ or $x \ge a$. In the first case, the inequalities $x \le a$ and $|x-a| < \delta \le \delta_-$ allow us to use the left continuity estimate, so
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
In the second case, the inequalities $x \ge a$ and $|x-a| < \delta \le \delta_+$ allow us to use the right continuity estimate, so again
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
Therefore the same radius $\delta$ controls every point of $E$ sufficiently close to $a$, which is exactly the relative continuity condition at $a$.
[/guided]
[/step]
[step:Conclude continuity at $a$]
We have shown that for every $\varepsilon > 0$ there exists $\delta > 0$ such that every $x \in E$ with $|x-a| < \delta$ satisfies
\begin{align*}
|f(x)-f(a)| < \varepsilon.
\end{align*}
This is precisely the definition of continuity of $f: E \to \mathbb R$ at $a$. Hence $f$ is continuous at $a$.
[/step]