Piecewise[ { {-x^2 + 2, x != 2}, {-5, x == 2} } ]