Example input are x=24,22,0,2,4 and the rule is y=1/2x-2 what are output?

well, divide x by 2 and then subtract 2

24/2 - 2 = 12-2 = 10
and so on for the others.