The other function gives a more complicated result.
You don’t really get to define functions in Wolfram|Alpha, so I’m not sure in what sense you mean you would like to evaluate those. In Mathematica, we would write out the code for f for example as follows:
f[x_]:= x/.{{2->1},{4->-2},{5->5},{-2->6}}
The syntax is the same for g. Once you’ve written it, you can evaluate f[g[6]] for example.
From what I can see, it looks like WolframAlpha currently doesn’t allow you to interpolate through points using natural language input. It instead treats it as a list of sequential values for interpolation. I’m sorry that I didn’t catch that this was going on.
There is a function in Mathematica for creating interpolating Polynomial called InterpolatingPolynomial. Luckily for us, it works in Wolfram|Alpha as well: