The two associated points on the graph of the function are
\begin{equation*}
(x_1,y_1)=(1,2) \quad \text{and} \quad (x_2,y_2)=(3,-2)
.
\end{equation*}
Using the slope formula, we find that
\begin{equation*}
m=\frac{y_2-y_1}{x_2-x_1}=\frac{-2-2}{3-1}=-2.
\end{equation*}
So, \(f(x)=-2x+b\text{.}\) The value of \(b\) is not immediately apparent as we were not given the value of the function at \(x=0\text{.}\) However, we can solve for it by using either one of the function values provided. For instance, we can use the fact that \(f(1)=2\) to set up an equation for \(b\text{.}\) Substituting \(x=1\) into \(f(x)=-2x+b\) results in
\begin{equation*}
-2\cdot 1+b=2.
\end{equation*}
Adding \(2\) to both sides allows us to conclude that \(b=4\text{.}\) Therefore, \(f(x)=-2x+4\text{.}\)