[proofplan]
We first justify that the operator $q(T)$ is invertible, so that the rational functional calculus expression $r(T)=p(T)q(T)^{-1}$ is well-defined. For an arbitrary complex number $\lambda$, we factor $r(T)-\lambda I$ through $q(T)^{-1}$ and reduce its invertibility to the invertibility of the polynomial operator $(p-\lambda q)(T)$. The polynomial spectral mapping theorem then converts this operator-theoretic invertibility question into the scalar condition that $p(\mu)-\lambda q(\mu)$ has no zero on $\sigma(T)$, which is exactly the condition $\lambda \notin r(\sigma(T))$ because $q$ has no zeros on $\sigma(T)$.
[/proofplan]
[step:Use polynomial spectral mapping to make $q(T)$ invertible]
Let $I \in \mathcal{L}(X)$ denote the identity operator. Since $q \in \mathbb{C}[z]$ is a polynomial, the polynomial functional calculus defines $q(T) \in \mathcal{L}(X)$. By the Polynomial Spectral Mapping Theorem (citing a result not yet in the wiki: Polynomial Spectral Mapping Theorem),
\begin{align*}\sigma(q(T))=q(\sigma(T)).\end{align*}
The hypothesis says that $q(\mu)\ne 0$ for every $\mu\in\sigma(T)$, hence
\begin{align*}0\notin q(\sigma(T))=\sigma(q(T)).\end{align*}
By the definition of the spectrum, $0\notin\sigma(q(T))$ means that $q(T)-0I=q(T)$ is invertible in $\mathcal{L}(X)$. Therefore $r(T):=p(T)q(T)^{-1}$ is a well-defined bounded operator on $X$.
[guided]
The first point is that the expression $r(T)=p(T)q(T)^{-1}$ only makes sense if $q(T)$ has a bounded inverse. We prove this from the pole-avoidance hypothesis. The polynomial $q \in \mathbb{C}[z]$ gives, through the polynomial functional calculus, an operator $q(T)\in\mathcal{L}(X)$. The relevant theorem is the Polynomial Spectral Mapping Theorem, which states that for a bounded operator $T$ and a polynomial $q$,
\begin{align*}
\sigma(q(T))=q(\sigma(T)).
\end{align*}
This theorem applies because $T\in\mathcal{L}(X)$ and $q$ is a complex polynomial.
Now the hypothesis says exactly that $q$ does not vanish at any point of $\sigma(T)$. Therefore the set $q(\sigma(T))$ does not contain $0$:
\begin{align*}
0\notin q(\sigma(T)).
\end{align*}
Using spectral mapping, this becomes
\begin{align*}
0\notin \sigma(q(T)).
\end{align*}
By the definition of the spectrum of a bounded operator, $0\notin\sigma(q(T))$ is equivalent to the invertibility of $q(T)-0I$, which is just $q(T)$. Thus $q(T)$ is invertible, and the rational functional calculus expression
\begin{align*}
r(T):=p(T)q(T)^{-1}
\end{align*}
is well-defined.
[/guided]
[/step]
[step:Factor $r(T)-\lambda I$ through the invertible operator $q(T)^{-1}$]
Fix $\lambda\in\mathbb{C}$. Define the polynomial $s_\lambda\in\mathbb{C}[z]$ by
\begin{align*}s_\lambda(z):=p(z)-\lambda q(z).\end{align*}
Since $p(T)$, $q(T)$, and $I$ are polynomials in $T$, the polynomial functional calculus gives
\begin{align*}s_\lambda(T)=p(T)-\lambda q(T).\end{align*}
Using $q(T)q(T)^{-1}=I$, we compute
\begin{align*}r(T)-\lambda I=p(T)q(T)^{-1}-\lambda q(T)q(T)^{-1}.\end{align*}
Hence
\begin{align*}r(T)-\lambda I=(p(T)-\lambda q(T))q(T)^{-1}=s_\lambda(T)q(T)^{-1}.\end{align*}
Since $q(T)^{-1}$ is invertible, the product $s_\lambda(T)q(T)^{-1}$ is invertible if and only if $s_\lambda(T)$ is invertible. Therefore
\begin{align*}\lambda\in\sigma(r(T)) \quad \iff \quad 0\in\sigma(s_\lambda(T)).\end{align*}
[/step]
[step:Translate the invertibility of $s_\lambda(T)$ into a scalar zero condition on $\sigma(T)$]
Apply the Polynomial Spectral Mapping Theorem to the polynomial $s_\lambda$. Since $s_\lambda\in\mathbb{C}[z]$ and $T\in\mathcal{L}(X)$,
\begin{align*}\sigma(s_\lambda(T))=s_\lambda(\sigma(T)).\end{align*}
Therefore
\begin{align*}0\in\sigma(s_\lambda(T)) \quad \iff \quad 0\in s_\lambda(\sigma(T)).\end{align*}
By the definition of image of a set under a function, the latter condition is equivalent to the existence of some $\mu\in\sigma(T)$ such that
\begin{align*}s_\lambda(\mu)=0.\end{align*}
Since $s_\lambda(\mu)=p(\mu)-\lambda q(\mu)$, this is equivalent to
\begin{align*}p(\mu)-\lambda q(\mu)=0\end{align*}
for some $\mu\in\sigma(T)$.
[/step]
[step:Use the nonvanishing of $q$ on $\sigma(T)$ to identify the image $r(\sigma(T))$]
For every $\mu\in\sigma(T)$, the hypothesis gives $q(\mu)\ne 0$. Thus, for $\mu\in\sigma(T)$,
\begin{align*}p(\mu)-\lambda q(\mu)=0\end{align*}
is equivalent to
\begin{align*}\lambda=\frac{p(\mu)}{q(\mu)}=r(\mu).\end{align*}
Combining the equivalences from the previous steps, for every $\lambda\in\mathbb{C}$ we have
\begin{align*}\lambda\in\sigma(r(T)) \quad \iff \quad \text{there exists } \mu\in\sigma(T) \text{ such that } \lambda=r(\mu).\end{align*}
The right-hand side is precisely the condition $\lambda\in r(\sigma(T))$. Hence
\begin{align*}\sigma(r(T))=r(\sigma(T)).\end{align*}
This proves the rational spectral mapping theorem.
[/step]