This seems very obvious and I am having a bit of trouble producing a formal proof.
sketch proof that the composition of two polynomials is a polynomial
Let $$p(z_1)=a_nz^n_1+a_{n-1}z^{n-1}_1+...+a_1z_1+a_0 \\ q(z_2)=b_nz^n_2+b_{n-1}z^{n-1}_2+...+b_1z_2+b_0$$ be two complex polynomials of degree $n$ where $a_n,..,a_0\in\mathbb{C}$ and $b_n,..,b_o\in\mathbb{C}$.
Now, \begin{align} (p\circ q)(z_2)&=p(q(z_2)) \ \ \ \ \ \text{(by definition)}\\ &=a_n(q(z_2))^n+a_{n-1}(q(z_2))^{n-1}+...+a_1(q(z_2))+a_0 \end{align} which is clearly a complex polynomial of degree $n^2$.
sketch proof that the composition of two rational functions is a rational function
A rational function is a quotient of polynomials.
Let $$a(z_1)=\frac{p(z_1)}{q(z_1)}, \ b(z_2)=\frac{p(z_2)}{q(z_2)}$$ Now, \begin{align} (a\circ b)(z_2)&=a(b(z_2)) \ \ \ \ \ \text{(by definition)} \\ &=\frac{p\left(\frac{p(z_2)}{q(z_2)}\right)}{q\left(\frac{p(z_2)}{q(z_2)}\right)} \\ &=\frac{a_n\left(\frac{p(z_2)}{q(z_2)}\right)^n+a_{n-1}\left(\frac{p(z_2)}{q(z_2)}\right)^{n-1}+...+a_1\left(\frac{p(z_2)}{q(z_2)}\right)+a_0}{b_n\left(\frac{p(z_2)}{q(z_2)}\right)^n+b_{n-1}\left(\frac{p(z_2)}{q(z_2)}\right)^{n-1}+...+b_1\left(\frac{p(z_2)}{q(z_2)}\right)+b_0} \\ \end{align} Notice that $\left(\frac{p(z_2)}{q(z_2)}\right)^i \ \ \ \ (i=n, n-1,..,0)$ is a polynomial as $$(f\circ g)(z_2)=f(g(z_2))=\left(\frac{p(z_2)}{q(z_2)}\right)^i$$ where $$f(x)=x^i, \ \ g(z_2)=\left(\frac{p(z_2)}{q(z_2)}\right)$$ are both polynomials. Hence $(a\circ b)(z_2)$ is a rational function as it is the quotient of polynomials.
Remark for your proof of composition of polynomials is a polynomial:
Remark for your proof of composition of composition rational functions is a rational function:
you wrote $a(z_1)=\frac{p(z_1)}{q(z_1)}$ and $b(z_2) = \frac{p(z_2)}{q(z_2)}$ which means $a$ and $b$ seems to be the same function.
$\left( \frac{p(z_1)}{q(z_2)}\right)^i$ is a rational function rather than a polynomial.
Guide for proof of composition of polynomials is a polynomial:
Guide for proof of composition of rational functions is a rational function: