Attributes[f] = {Listable}
 
f[x_] := If[x > 0, x^2, -x]
