Factorization of polynomials into polynomials of smaller degree
Obviously we have $$ x^6 -5x^3 +4x^2 -7x^3 =(x^4 - 12x + 4)x^2, $$ where the first factor is irreducible over $\Bbb Q$. In general factoring is hard, but there are several algorithms - see wikipedia. For polynomials of lower degree it thus no problem to obtain a factorisation.
To show that a polynomial like $x^4-12x+4$ is irreducible, one often can use the extended Eisenstein criterion. Also, a direct computation is possible for low degree, and several other criteria.