I have $2$ variables $i$ and $z$. The value of $z$ depends on the value of $i$ as:
$$i=6 \implies z=7 \\ i=7 \implies z=5 \\ i=8\implies z=3 \\ i=9\implies z=1 $$
How to find an equation involving $i$ and $z$ that satisfies all the values above for $i$ and $z$?
Notice that as $i$ increases by $1$, $z$ decreases by $2$. Therefore there is a linear relationship that can be represented as $z=-2i+b$ for some currently unknown $b$. But since you know that you have points to replace $z$ and $i$ with, you can solve for the unknown $b$ as
$$z=-2i+b$$ $$7=-2(6)+b$$ $$7=-12+b$$ $$7+12=b$$ $$19=b$$
And therefore you have that $z=-2i+19$. Does it work for the remaining points? You can check to see it does.
Now is the the ONLY function with this property? Certainly not, but this is most likely the simplest one, and since we deduced the relation contains linear changes, then we have found an equation where the givens are satisfied.