I do not use Wolfram Alpha, but I think Wolfram alpha can understand the Wolfram language, and if so, try
f[x_] := Piecewise[{{10 - x, -1 <= x <= 3}, {x^2 - 2, 3 < x <= 4}, {0, True}}]
The above works ok in Mathematica (which uses the Wolfram language).