The function f(x) takes a numerical input x and returns the output value that is the product of x and a constant value, either 2 or -2, depending on the sign of x.

