Here it is very easy to see how the standard basis vectors can be written as linear combinations of the vectors in B.
Example:
$(1,0,0)=(1,1,0)-(0,1,0)$
Therefore $T((1,0,0))=T((1,1,0))-T((0,1,0))$
Moreover we know that $T((1,1,0))=2(1,1,0)+n(0,1,0)=(2,2+n,0)$ and that $T((0,1,0))=(m,m,0)$, whence $T((1,0,0))=(2-m,2+n-m,0)$.
This is the first column in your sought after matrix, and you can do similarly with the other two standard basis vectors.
The more general approach is to first find the change of basis matrices $P_{\mathcal{B}\rightarrow{\mathcal{E}}}$ and $P_{\mathcal{E}\rightarrow{\mathcal{B}}}$, where $\mathcal{E}$ denotes the standard basis. One then has the following formula:
$[T]_{\mathcal{E}}=P_{\mathcal{E}\rightarrow{\mathcal{B}}}[T]_{\mathcal{B}}P_{\mathcal{B}\rightarrow{\mathcal{E}}}$
First, we need to check where our basis for $\mathbb{R}^4$ is sent.
$$e_1\mapsto (1,0,1)=f_1+f_3$$
$$e_2\mapsto (0,2,0)=2f_2+4f_3$$
$$e_3\mapsto (-2,1,0)=-2f_1+f_2$$
$$e_4\mapsto (1,0,1)=f_1+f_3$$
So, using the matrix "algorithm"
$$ A=\begin{bmatrix}
1&0&-2&1\\
0&2&1&0\\
1&4&0&1\\
\end{bmatrix}.$$
More precisely: given a linear transformation $T:V\to W$, where $V$ and $W$ are abstract vector spaces (over $\mathbb{F}$) with bases $v_1,\ldots,v_n$ and $w_1,\ldots,w_m$ respectively, the $i^{th}$ column of the matrix representing $T$ with respect to these bases is
$$ \begin{pmatrix}
a_{1,i}\\
\vdots\\
a_{m,i}
\end{pmatrix}.$$
Here the $a_{j,i}\in\mathbb{F}$ are the coefficients satisfying
$$ T(v_i)=\sum_{k=1}^m a_{k,i}w_k.$$
Best Answer
Let $e_1=(1,0,0)$, $e_2=(0,1,0)$, and $e_3=(0,0,1)$.
From the definition of $T$: $$ T(e_1) =\left[\matrix{3\cr -1\cr 0 }\right],\quad T(e_2) =\left[\matrix{-1\cr 0\cr -1 }\right],\quad T(e_3) =\left[\matrix{0\cr 1\cr 1 }\right]. $$ For an arbitrary vector $v=\left[\matrix{a\cr b\cr c }\right] =a e_1+b e_2+c e_3$, we have using the linearity of $T$ $$\eqalign{ T(v) &=T(a e_1+b e_2+c e_3)\cr &=a T(e_1)+b T(e_2)+c T(e_3)\cr &=a \left[\matrix{3\cr -1\cr 0 }\right]+ b\left[\matrix{-1\cr 0\cr -1 }\right]+ c\left[\matrix{0\cr 1\cr 1 }\right]\cr &= \left[\matrix{3a-1\cdot b+0\cdot c\cr -1\cdot a+0\cdot b+1\cdot c\cr 0\cdot a+1\cdot -b+1\cdot c }\right]\cr &= \left[\matrix{3&-1&0 \cr -1&0& 1\cr 0&-1& 1}\right] \left[\matrix{a\cr b\cr c}\right].\cr } $$ So the matrix representation of $T$ is $\left[\matrix{3&-1&0 \cr -1&0&1\cr 0&-1&1}\right]$.
Note that the $i^{\rm th}$ column of the matrix representing $T$ is the vector $T(e_i)$. So, we can get the desired!