Can someone please help me find any elementary function that satisfies
$f(0) = 6$
$f(1) = f(-1) = 4$
$f(2) = f(-2) = 1$?
I have been trying for nearly an hour, but I still can't figure it out. Only the points listed above matter. Nothing else matters (I don't care what $f(1.5)$ or $f(3)$ or $f(-100)$ are).
The symmetry motivated me to try and use absolute value, but it didn't get me anywhere since there is nonconstant slope.
Many functions work. Here's one way to get a fairly simple one:
We can fit a quadratic through the values at $0,1,2$. That leads us to $6-\frac 12(x^2+3x)$. Now we can use the absolute value to extend this symmetrically to the negative values, arriving at $$f(x)=6-\frac {x^2}2-\frac {3|x|}2$$
Alternatively, we could fit a quartic through the five given points and thereby avoid the use of the absolute value, though at the cost of increasing the degree. I think the quadratic (with the absolute value) is the more elementary solution.