There is nothing in the knowledge base of Wolfram Alpha that you need for this
1. DO NOT press the equal sign before writing f[x_]:=x^2
then you can use this definition
2. If you insist to press the equal sign, Wolfram Alpha do not evaluate it to something you can use. it just "tries to check" if f[x_] equals to x^2, but since there is no definition to f, it is returned unevaluated.
after you "evaluation" (of step 2 of course) you can try
and get a response
meaning that f is just a symbol, and as such it cannot evaluate the square function, since it does not exist