what is the function rule for

input x 1,2,3,4,5 and
output 3,2,0,-1,-2

That is not a linear relationship. I think you may have copied the problem wrong. The bottom row should be

3,2,1,0,-1. If it is, the function rule is
y = -x + 4