# How do you verify that a function is the inverse of another function?

I think the easiest way is to calculate g(f(x)) or f(g(x)), but I don't know if it works in every case.

-
That's the definition, It does work when you can actually calculate :). A way to get a ballpark is to see if the graphs of $f$ and $g$ are a reflection of each other around the line $x=y$. – gt6989b Nov 29 '12 at 16:25
You could also try taking the equation $y = f(x)$ and solving it for $x$, which will end up giving you $g(y) = x$ if $g$ is the inverse of $f$. – Brad Nov 29 '12 at 16:27

To verify or prove that $g(x)$ is the inverse of $f(x)$, you need to show that $g(f(x)) = f(g(x)) = x$.
That is, you show both $g(f(x)) = x$ and $f(g(x)) = x$.
If you can show this, then you can conclude $g(x) = f^{-1}(x)$. (Alternatively, and equivalently, you can conclude $f(x) = g^{-1}(x)$).