I want to know if the following proposition is true or false :
Let $p$ and $q$ $\in \mathbb Q[X]$ two polynomials of degree $\geq 1$ and let $g$ $\in \mathbb Q[X]$ an irreducible unitary polynomial, with deg(g) $\geq 1$ such that $\exists$ two polynomials $a$ and $b$ $\in \mathbb Q[X]$ with $g = ap + bq$. Then $g = gcd(p,q)$.
I have the feeling that it is true with a few tests but I don't know how to prove it and I feel like something is wrong with the fact that we are $\mathbb Q[X]$. What if we are $\mathbb R[X]$ ?
(I also have that $x-\frac74=(\frac18x+\frac14)(x-1)-(\frac18x-\frac12)(x-3)$ but $x-\frac74$ does not seem to be $(x-1)$ and $(x-3)$'s gcd).
You have a good counterexample, so the proposition doesn't hold.
There's no particular reason to expect that it would hold, either. The claim is a converse of Bézout's identity for $\mathbb Q[X]$, but nobody says such a converse has to hold anywhere.
In fact, the corresponding converse doesn't even hold in $\mathbb Z$: There we know well that $ap+bq$ can be any multiple of the gcd of $p$ and $q$, and just because $ap+bq$ is prime (that is, irreducible) doesn't mean that this multiple needs to be the gcd itself. Namely, it might be that $p$ and $q$ are coprime, in which case anything in $\mathbb Z$ can be written as $ap+bq$.
That's essentially what goes on in your counterexample too: $\gcd_{\mathbb Q[X]}(x-1,x-3)=1$, so you can get anything you want as a sum of polynomial multiples of those two factors. Just pick any $g$ and let $a=\frac12g$ and $b=-\frac12g$ ...
Working over $\mathbb R[X]$ wouldn't make a difference here.