"Composition of functions" refers to appling to functions in succession. For example, if [itex]f(x)= x^3[/itex] (whatever x is, cube it) and [itex]g(x)= x+ 2[/itex] (whatever x is, add 2) then composition g(f(x)) means- what ever x is, first cube it, then add 2. Here, [itex]g(f(x))= x^3+ 2[/itex]. Composition of functions is NOT "commutative"- that is, changing the order may give a different result: g(f(x)), here, means "first add 2 then cube the result: [itex]f(g(x))= (x+ 3)^3= x^3+ 9x^2+ 27x+ 27[/itex].
Of course, whenever we do an operation, we would like to be able to "undo" it. That is exactly what the "inverse" function does: If we write [itex]f^{-1}(x)[/itex] to mean its inverse function, [itex]f^{-1}(f(x))= x[/itex] and [itex]f(f^{-1}(x))= x[/itex], With [itex]f(x)= x^3[/itex], [itex]f^{-1}(x)= \sqrt[3](x)= x^{1/3}[/itex]. That is, the "inverse" of cubing is the cube root. [itex]f(f^{-1}(x)= (\sqrt[3](x))^3= x[/itex] or [itex]f(f^{-1}(x))= (x^{1/3})^3= x[/itex] and [itex]f^{-1}(f(x))= \sqrt[3](x^3)[/itex] or [itex]f^{-1}(f(x))= (x^3)^{1/3}= x[/itex].
Similarly if g(x)= x+ 3, then [itex]g^{-1}(x)= x- 3[/itex]. That is, the inverse of "add three" is "subtract 3". [itex]g(g^{-1}(x))= (x- 3)+ 3= x[/itex] and [itex]g^{-1}(g(x))= (x+ 3)- 3= x[/itex].
More generally, we can think of "y= f(x)" as a set of pairs of numbers, f= {(x,y)}= {(x, f(x))}. And then the inverse just swaps "x" and "y"- the pairs corresponding to (y, x): [itex]f^{-1}= (y, x)= (y, f^{-1}(y))[/itex]
You need to be aware that many functions do NOT have inverses! For example, the function [itex]f(x)= x^2[/itex] does not have an inverse because both f(-2) and f(2) are equal to 4 so there is no single number we can call "[itex]f^{-1}(4)[/itex]. What we often do in that case is restrict the domain so the function is "one to one"- but then we have a different function. If we define [itex]f(x)= x^2[/itex] with x restricted to be non-negative, then we can say that [itex]f^{-1}(x)= \sqrt{x}[/itex]. And if we define [itex]g(x)= x^2[/itex] with x restricted to be non-positive, then [itex]g^{-1}(x)= -\sqrt{x}[/itex].