We say that a polynomial $f$ is decomposable if there are (not linear) polynomials $g,h$ such that $f = g \circ h.$
Is there a function in Sage doing this?
As far as I can see the function is present in Mathematica under the name Decompose http://reference.wolfram.com/language/ref/Decompose.html.