Determine matrix A from linear transformations Let $T:R^3\rightarrow R^3$ be the linear transformation such that
$$
T
\left[
\begin{array}{c}
1\\
1\\
1\\
\end{array}
\right]
=\left[
\begin{array}{c}
-2\\
5\\
-2\\
\end{array}
\right],\,\,
T
\left[
\begin{array}{c}
1\\
1\\
0\\
\end{array}
\right]
=\left[
\begin{array}{c}
4\\
1\\
4\\
\end{array}
\right],\,\,
T
\left[
\begin{array}{c}
1\\
0\\
0\\
\end{array}
\right]
=\left[
\begin{array}{c}
1\\
-1\\
1\\
\end{array}
\right]
$$

a) Find a matrix $A$ such that $T(x)=Ax$ for every $x \in R^3$
b) Find a linearly independent set of vectors in $R^3$ that spans the range of $T$

I have absolutely no idea how to do these two questions and my textbook does not provide any similar examples. Could someone be kind enough to explain the logic behind answering these questions? Your help is appreciated! 
 A: Presumably your book wants the answer in terms of the standard basis. For ease of typing, I will use row vectors instead of column vectors.
Due to linearity, we can see: $T(0,0,1) = T(1,1,1) - T(1,1,0) = (-2,5,-2) - (4,1,4) = (-6,4,-6)$. Similarly, we can see $T(0,1,0) = T(1,1,0) - T(1,0,0) = (4,1,4) - (1,-1,1) = (3,2,3)$. So then the matrix for $T$ with respect to the standard basis is: $$\left[ \begin{array}{ccc} 1 & 3 & -6 \\ -1 & 2 & 4 \\ 1 & 3 & -6 \end{array}\right].$$
The range of this transformation will be spanned by the column vectors of this matrix. We must find a linearly independent subset of them in order to answer your question.
As noted in the comments, column 3 is redundant as it can be expressed as a linear combination of the other columns. Thanks to @Ian.
A: You should be able to see that the set of vectors 
$$ u_1=\left[
\begin{array}{c}
1\\
1\\
1\\
\end{array}
\right], u_2=\,\left[
\begin{array}{c}
1\\
1\\
0\\
\end{array}
\right], u_3 =\, \left[
\begin{array}{c}
1\\
0\\
0\\
\end{array}
\right] $$
spans $\mathbb{R^3}$. Let $X\in \mathbb{R^3}$ so we can write it as
$$ X = a \,u_1 + b \,u_2 + c\, u_3 .$$
where $a,b,c$ are the coordinates of the vector $X$ with respect the above basis. Apply the operator $T$ to the vector $X$ gives
$$ T(X) = aT(u_1)+ bT(u_2)+ c T(u_3) = a\left[
\begin{array}{c}
-2\\
5\\
-2\\
\end{array}
\right] + b\left[
\begin{array}{c}
4\\
1\\
4\\
\end{array}
\right]+ c \left[
\begin{array}{c}
1\\
-1\\
1\\
\end{array}
\right]= \left[ \begin{array}{ccc} -2 & 4 & 1 \\ 5 & 1 & -1 \\ -2 & 4 & 1 \end{array}\right] \left[
\begin{array}{c}
a\\
b\\
c\\
\end{array}
\right] = A X.$$
I let you finish the problem.
