I am reading "Measure, Integration & Real Analysis" by Sheldon Axler.
Your problem is Exercise 11 on p.24 in Exercises 2A in the above book.
I solved Exercise 11 as follows:
My lemma 1:
Let $a_1,b_1,a_2,b_2,\dots,a_N,b_N$ be any real numbers such that $a_1\leq b_1\leq a_2\leq b_2\leq\dots\leq a_N\leq b_N$.
Then, $$(b_1-a_1)+(b_2-a_2)+\dots+(b_N-a_N)\\=|(a_1,b_1)\cup (a_2,b_2)\cup\dots\cup (a_N,b_N)|\\=|[a_1,b_1]\cup [a_2,b_2]\cup\dots\cup [a_N,b_N]|$$ holds.
My proof of my lemma 1:
We consider the case in which $N=1$.
Let $a_1\leq b_1$.
By 2.14 on p.20 in the book, $|[a_1,b_1]|=b_1-a_1$.
By Exercise 6 on p.23 in Exercises 2A in the book, $|(a_1,b_1)|=b_1-a_1$.
So, $b_1-a_1=|(a_1,b_1)|=|[a_1,b_1]|$ holds.
We assume $$(b_1-a_1)+(b_2-a_2)+\dots+(b_k-a_k)\\=|(a_1,b_1)\cup (a_2,b_2)\cup\dots\cup (a_k,b_k)|\\=|[a_1,b_1]\cup [a_2,b_2]\cup\dots\cup [a_k,b_k]|$$ holds for any real numbers $a_1,b_1,a_2,b_2,\dots,a_k,b_k$ such that $a_1\leq b_1\leq a_2\leq b_2\leq\dots\leq a_k\leq b_k$.
We now prove $$(b_1-a_1)+(b_2-a_2)+\dots+(b_{k+1}-a_{k+1})\\=|(a_1,b_1)\cup (a_2,b_2)\cup\dots\cup (a_{k+1},b_{k+1})|\\=|[a_1,b_1]\cup [a_2,b_2]\cup\dots\cup [a_{k+1},b_{k+1}]|$$ holds for any real numbers $a_1,b_1,a_2,b_2,\dots,a_{k+1},b_{k+1}$ such that $a_1\leq b_1\leq a_2\leq b_2\leq\dots\leq a_{k+1}\leq b_{k+1}$.
Note that $(a_1,b_1)\cup\dots\cup (a_{k+1},b_{k+1})=(a_1,b_{k+1})\setminus\left([b_1,a_2]\cup [b_2,a_3]\cup\dots\cup [b_k,a_{k+1}]\right)$ holds.
By Exercise 3 on p.23 in Exercises 2A in the book and by our induction hypothesis, $$|(a_1,b_1)\cup\dots\cup (a_{k+1},b_{k+1})|\geq |(a_1,b_{k+1})|-|\left([b_1,a_2]\cup [b_2,a_3]\cup\dots\cup [b_k,a_{k+1}]\right)|\\=(b_{k+1}-a_1)-\left((a_2-b_1)+(a_3-b_2)+\dots+(a_{k+1}-b_k)\right)\\=(b_1-a_1)+\dots+(b_{k+1}-a_{k+1})$$ holds.
Of course $$(b_1-a_1)+\dots+(b_{k+1}-a_{k+1})\geq |[a_1,b_1]\cup\dots\cup [a_{k+1},b_{k+1}]|\geq |(a_1,b_1)\cup\dots\cup (a_{k+1},b_{k+1})|$$ holds.
Therefore $$(b_1-a_1)+(b_2-a_2)+\dots+(b_{k+1}-a_{k+1})\\=|(a_1,b_1)\cup (a_2,b_2)\cup\dots\cup (a_{k+1},b_{k+1})|\\=|[a_1,b_1]\cup [a_2,b_2]\cup\dots\cup [a_{k+1},b_{k+1}]|$$ holds for any real numbers $a_1,b_1,a_2,b_2,\dots,a_{k+1},b_{k+1}$ such that $a_1\leq b_1\leq a_2\leq b_2\leq\dots\leq a_{k+1}\leq b_{k+1}$.
We now prove Exercise 11 as follows:
If there exists an open interval $I_k$ such that $I_k=(-\infty,a)$ for some $a\in\mathbb{R}$ or $I_k=(a,\infty)$ for some $a\in\mathbb{R}$ or $I_k=(-\infty,\infty)$, then it is obvious that $$\left|\bigcup_{k=1}^{\infty} I_k\right|=\sum_{k=1}^{\infty} \mathcal{l}(I_k)=\infty$$ holds.
So, we assume that there doesn't exist such an open interval in $\{I_1,I_2,\dots\}$.
By my lemma 1, $$\sum_{k=1}^{N} \mathcal{l}(I_k)=\left|\bigcup_{k=1}^{N} I_k\right|\leq\left|\bigcup_{k=1}^{\infty} I_k\right|\leq\sum_{k=1}^{\infty} \left|I_k\right|=\sum_{k=1}^{\infty} \mathcal{l}(I_k)$$ holds.
So, $$\left|\bigcup_{k=1}^{\infty} I_k\right|=\sum_{k=1}^{\infty} \mathcal{l}(I_k)$$ holds.
Your proof is correct. It can be simplified a bit. If you prove
$$
|(a,b)|=|[a,b]|= b-a
$$
first then the remaining equalities follow from
$$
(a, b) \subset (a, b] \subset [a, b]
$$
and
$$
(a, b) \subset [a, b) \subset [a, b]
$$
because of the order preserving property.
Best Answer
After your edits, your solution looks pretty good and I have little in the ways of mathematical criticism to offer. I would just say that it is generally considered better style to write more words, fewer symbols and avoid "itemizing" the logical structure of your proof more than necessary. Basically, you want your proof to look more like an ordinary piece of prose, and less like computer code.
A solution more in keeping with these principles might look something like this: