Theorem:
A function $f:D\to \mathbb R$ is continuous in $a\in D$ $\iff f$ is left and right continuous in $a$.
Proof:
I firstly thought just to write down the definitions of left and right continuous and then it trivially shows the theorem. But apparently it isn't sufficient.
Let $f:D\to\mathbb R$ and consider $a\in D$. The function $f$ is rightcontinuous in $a \iff$ $$(\forall\epsilon\gt 0)(\exists\delta\gt 0)(a\le x\lt a+\delta\Rightarrow |f(x)-f(a)|\lt\epsilon)$$
and left continous $\iff$ $a \iff$ $$(\forall\epsilon\gt 0)(\exists\delta\gt 0)(a -\delta\lt x\le a\Rightarrow |f(x)-f(a)|\lt\epsilon)$$
So I found a proof online on this webpage.
My question is there another way to prove this maybe with the use of my definitions? I'd most appreciate it.
We show that if $f$ is left and right continuous, it is continuous. (The other direction is easier, can you do it?)
Let $f$ be left and right continuous at $a$. Let $\epsilon>0$. There are $\delta_l>0$ and $\delta_r>0$ with $a-\delta_l<x\le a\Longrightarrow |f(x)-f(a)|<\epsilon$ and $a\le x <a+\delta_r\Longrightarrow |f(x)-f(a)|<\epsilon$.
Now as the hint said, choose $\delta=\min(\delta_l,\delta_r)$. Then if $|x-a|<\delta$, either $x\le a$ or $x\ge a$. In the first case, $x>a-\delta>a-\delta_l$ and so $|f(x)-f(a)|<\epsilon$. In the second case, $x<a+\delta<a+\delta_r$ and so $|f(x)-f(a)|<\epsilon$ and the function is continuous.
The textbook solution you showed uses an equivalent characterisation of convergence using sequences.