How to decompose function like $x^2+x-6$? I was trying to wrap my brain around this but could not think of anything. I am very poor at maths but trying to learn of it.
Edit:
Exact question is

If $x^2+x-6$ is a composite function $f(g(x))$; then figure out $f(x)$ and $g(x)$ ?

To me information looks incomplete to figure out such details.
 A: We always have
$(x+a)(x+b) = x(x+b)+a(x+b) = (x\times x)+(x\times b)+(a\times x)+(a\times b) = (x^2)+(b\times x)+(a\times x)+(a\times b)$
$(x^2)+(b\times x)+(a\times x)+(a\times b) = (x^2)+(a\times x)+(b\times x)+(a\times b) = (x^2)+((a+b)\times x)+(a\times b)$
$(x+a)\times (x+b) = (x^2)+((a+b)\times x)+(a\times b)$

Converting your equation to that form gives
$x^2+x-6 = (x^2)+(1\times x)+(-6)$
where we want
$(x^2)+(1\times x)+(-6) = (x^2)+((a+b)\times x)+(a\times b)$

So, we're looking for numbers whose sum is $1$ and whose product is $-6$.
$a+b = 1$  and  $ab = -6$

That should be enough for you to figure it out, but in case it's not,

if you just want the answer you can put
"n vf rdhny gb artngvir gjb naq o vf rdhny gb cbfvgvir guerr"
into rot13.com
A: The 'simplest' possibility is $f(x) := x-3$ and $g(x) := x^2+x-3$.
It is the more natural of the $2$ pairs of integer polynomials of degree at most $2$ that minimize the sum of squares of their coefficients while composing to give $x^2+x-6$.
...
and apparently it's not this easy to get back the account I created on another computer.
A: The context of this question suggests that $f=f(x)$ and $g=g(x)$ are going to be polynomials (with either real, rational or integer coefficients).  If this is the case then...
Hint: While there's going to be an infinite number of functions $f,g$ for which $f(g(x))=x^2+x-6$, there will only be two situations when this can occur (consider the degrees of $f$ and $g$, and how that effects $f(g(x))$).  These can be classified by setting $f$ and $g$ as arbitrary polynomials of the appropriate degrees, composing them, then equating coefficients with $f(g(x))=x^2+x-6$.
If $f$ and $g$ are not restricted to polynomials, there's going to be all sorts of functions $f$ and $g$ for which $f(g(x))=x^2+x-6$.  For example: Let $A=\left(\begin{matrix}-2 & 1 \\ 4 & 1 \end{matrix}\right)$.  Then the characteristic polynomial $\det(A-xI)=(-2-x)(1-x)-4=x^2+x-6$.
A: Since I don't think anyone else has covered it and because it can be useful for thinking about inverse functions/relations, consider completing the square:
$$\begin{align}
f(x)&=x^2+x-6
\\
&=x^2+x+\frac{1}{4}-\frac{25}{4}
\\
&=\left(x+\frac{1}{2}\right)^2-\frac{25}{4}
\end{align}$$
so $f(x)=a(b(c(x)))$ where $a(x)=x-\frac{25}{4}$, $b(x)=x^2$, and $c(x)=x+\frac{1}{2}$.  The advantage here (though probably not significant for your purpose) is that each of these functions can be thought of as a single simple operation on their input (that the input appears only once in each function also makes it easier to think of this way).
