This question is also asked here and here
That last step, of requiring $\lvert x - a \rvert < 2\delta_3$ does seem suspicious. Your proof I think requires $x$ and $a$ to be close enough together that they can both be sufficiently close to a neighborhood of y's, such that all the inequalities hold.
Be careful about adding together $\delta$ requirements, which is not always a logical thing to do. For example, If we require that $k < 1$, and also $k < 35$, adding these together doesn't really provide useful information. $2k < 36$ is still a true requirement, but it's not a sufficient one, and it obscures the more strict $k < 1$.
I suspect that requiring $\lvert x - a \rvert < \delta_3$ is sufficient. If $2 \delta_3$ works, than certainly $\delta_3$ would also. I think $2 \delta_3$ works, but just barely (I don't think it would work if $<$ was replaced with $\leq$.)
This problem comes up in Calculus by Spivak, Chapter 6, problem 16(d).
I think I mostly understand the answer from Spivak. I'll try to outline the main steps, leaving details to you. Hopefully if I'm wrong about anything, someone will jump in.
Maybe this other approach will be helpful.
First, we can use the definition of limits and $g(x)$ to show that for any $\varepsilon > 0$ there is a $\delta > 0$ such that for all $y$, if
$$0<\lvert y - a \rvert < \delta$$ then,
$$\lvert f(y) - g(a) \rvert < \varepsilon$$
and so,
$$g(a)-\varepsilon < f(y) < g(a) + \varepsilon$$
The next bit is tricky and I'm not sure I completely understand it:
We set $x$ within $\delta$ of $a$, and then take the limit of all sides of the above inequality for $y$ approaching $x$:
For all $x$, if
$$0<\lvert x - a \rvert < \delta$$
then,
$$\lim\limits_{y \to x} (g(a)-\varepsilon) \leq \lim\limits_{y \to x} f(y) \leq \lim\limits_{y \to x}(g(a) + \varepsilon)$$
From here, with some manipulation you should be able to show that $\lim\limits_{x \to a} g(x) = g(a).$
I'd like to return to that limit over the inequality step. First, notice that the signs change from $< to \leq$. This is a consequence of taking the limit and I won't go into the proof here, unless requested. Besides that, what's our justification for taking the limit over the inequality? How do we know that for $y$ approaching $x$, this inequality remains true? The original condition required y to be within
$$0<\lvert y - a \rvert < \delta$$
I think the idea is, because $x$ is within this same region and there is "space" around $x$, i.e. $x \neq a-\delta$, or $a+\delta$, there are open intervals around $x$ that are contained in the region. So for $y$'s very close to $x$, we know these $y$'s are in $0<\lvert y - a \rvert < \delta$, and thus the inequalities still hold.
It makes sense to pick $x$ near $a$, as we're trying to show what happens to $g(x)$ as $x$ approaches $a$.
Admittedly, it makes sense to me in retrospect. Can't say I would ever have thought to do it on my own.