I am required to prove that the interval $(a,b)$ is a $F_{\sigma}$-set i.e. it can be written as a union of countably many closed sets in $\mathbf{R}$.
The following is my attempt so far.
I did not have any credible ideas in the beginning so i decided to examine the special case for $(0,1)$ and proceeded as follows \begin{align*} (0,1) &= \left(0,\frac{1}{2}\right]\cup\left[\frac{1}{2},1\right)\\ &=\bigcup_{n=1}^{\infty}[a_n,a_{n+1}]\cup\bigcup_{n=1}^{\infty}[b_n,b_{n+1}] \\ \end{align*} $$\text{where }a_n = \left\{\frac{1}{n+1}\right\}\text{ and } b_n = \left\{1-\frac{1}{n+1}\right\}$$ It then occured to me that $(0,1)\cong(a,b)$ where one possible bijection $f:(0,1)\to(a,b)$ is defined as follows $$f(x) = x(b-a)+a$$ consequently we have (I am certain that i have computed the following correctly)
$$f(a_n) = f\left(\frac{1}{n+1}\right) = \frac{b+an}{n+1}$$ $$f(b_{n}) = f\left(1-\frac{1}{n+1}\right) = \frac{bn+a}{n+1}$$ $$f(a_{n+1}) = f\left(\frac{1}{n+2}\right) = \frac{b+a(n+1)}{n+2}$$ $$f(b_{n+1}) = f\left(1-\frac{1}{n+2}\right) = \frac{b(n+1)+a}{n+2}$$which leads to the following conjecture
$$(a,b) = \bigcup_{n=1}^{\infty}[f(a_n),f(a_{n+1})]\cup\bigcup_{n=1}^{\infty}[f(b_n),f(b_{n+1})]$$
Now i am fairly confident that this works since $$\lim_{n\to\infty}f(a_n) = \frac{b+an}{n+1} = \frac{b/n+a}{1+1/n} = a$$ $$\lim_{n\to\infty}f(b_n) = \frac{bn+a}{n+1} = \frac{a/n+b}{1+1/n} = b$$
My only problem then is how do i articulate the above story as a proper argument and preferably a simple argument.
This is where i am stuck. Any suggestions?
Part of the problem here is that your formulas for $f^{\rightarrow}([a_n,a_{n+1}])$ are so complicated.
Instead, you should reduce the problem to the $(0,1)$ case, and then solve that. How about this lemma:
To prove the lemma follows very quickly from the definitions. You will need the fact that the preimage of any closed set under a continuous function is closed, and that preimages preserve unions.
Then use $g=f^{-1}$ (to borrow your notation) and write $$(0,1)=\bigcup_{n=1}^{\infty}{\left(\left[\frac{1}{n+1},\frac{1}{n}\right]\cup\left[1-\frac{1}{n},1-\frac{1}{n+1}\right]\right)}$$
(I've taken the liberty of redistributing your unionands; there are multiple equivalent ways to do this.)