We observe that a line will pass through 3 points, but to find a slope we only need two.
We see that it passes through points (assuming the scale of graph is 1 : 1) [tex]P_1(x_1,y_1)=P_1(0,1)[/tex] and [tex]P_2(x_2,y_2)=P_2(2,-1)[/tex].
We can use slope formula that applies for any line and produce the same slope for any two different points on the line
[tex]m=\dfrac{\Delta{y}}{\Delta{x}}=\dfrac{y_2-y_1}{x_2-x_1}=\dfrac{-1-1}{2-0}=-1[/tex]
So the slope is -1 also it intersects y-axis at [tex]n=1[/tex] so the general form of the linear function is
[tex]f(x)=mx+n[/tex]
That is in your case
[tex]\boxed{f(x)=-x+1}[/tex]
Hope this helps.