Let $g(x)=ax^2+bx+1\in\mathbb{Z}[x]$ and $f(x)=(x-a_1)(x-a_2)...(x-a_n), n\geq 7$ ($a_i\in\mathbb{Z}$ are pairwise distinct). Prove that in $\mathbb{Q}[x]$, if $g(x)$ is irreducible then $g(f(x))$ is also irreducible.
My attempt
Assume $g(x)$ is irreducible but $g(f(x))$ is not.
Then, there exists $u(x),v(x)\in\mathbb{Z}[x], 0<degu\leq degv<2n.$ Since $u(a_i)v(a_i)=g(f(a_i))=g(0)=1$, we deduce $u(a_i)=v(a_i)=\pm 1$.
Of course $0<degu\leq n\leq degv$. Also, we can assume that $$u(a_1)=u(a_2)=...=u(a_k)=1$$
$$u(a_{k+1})=u(a_{k+2})=...=u(a_n)=-1\quad \left(k\geq \dfrac{n}{2}\right).$$
Because $0<degu\leq n$, hence $k\leq n$.
We can write $$u(x)-1=(x-a_1)(x-a_2)...(x-a_k)q(x)\quad (q(x)\in\mathbb{Z}[x], degq\geq 0)$$
Hence $$-2=(a_n-a_1)(a_n-a_2)...(a_n-a_k)q(a_n)$$
Because $n\geq 7$ and $k\geq\dfrac{n}{2}$, hence $k\geq 4$.
If $k<n$ then we have $(a_n-a_1)(a_n-a_2)...(a_n-a_4)$ | $(-2)$ and $a_n-a_1,a_n-a_2,a_n-a_3,a_n-a_4 $are pairwise distinct integers (INVALID!!!). So we must have $k=n\Rightarrow degu=n\Rightarrow degv=n$.
So we can write $u(x)=\alpha f(x)+1\quad (\alpha\in\mathbb{Z})$ and with the same argument, we also have $v(x)=\beta f(x)+1\quad (\beta\in\mathbb{Z})$
Since $0<degu\leq degv$, we must have $\alpha,\beta\neq 0$. So we come to this equation $$g(f(x))=(\alpha f(x)+1)(\beta f(x)+1)$$
Does this mean anything or contracdict with anything? I don't know how to continue. Does anyone have any ideal or other approach to this problem?
You are almost done:
If the equation $$g(f(x)) = (\alpha f(x)+1)(\beta f(x)+1)$$ holds, then subsituting $u=f(x)$, the equation $$g(u) = (\alpha u +1)(\beta u +1)$$ also holds for all $u$ in range$(f(x))$. As $f$ is nonconstant, it follows that there are an uncountable number of such $u$ [in particular more than $2n$ such $u$], so it follows that the equation $$g(u) = (\alpha u +1)(\beta u +1)$$ holds for all $u$. [Indeed, if two polynomials of degree $2n$ or less agree on more than $2n$ points then they must be the same polynomial.]
But then this gives $g$ reducible after all.