Find a linear transformation such that $S^2 = T$ (general case) Suppose a linear transformation $T:\mathbb{R}^3\rightarrow \mathbb{R}^3$, $T\begin{pmatrix}
x\\ 
y\\ 
z
\end{pmatrix} = \begin{pmatrix}
x+y\\ 
y+z\\ 
z+x
\end{pmatrix}$ (just an example).
How do i find a linear transformation S such that $S^2=S\circ S=T$ ?
it's part of a basic linear algebra course. Would appreciate a general answer (not specific to the example above). Iv'e already tried several ways, didn't manage to get somewhere.. 
Thanks.
EDIT: The answer is supposed to be based only on basic matrices and linear transformations material, no Diagonalization and eigenvalues 

If your $T$ is just an example, if you are wondering whether there are linear transformations/matrices such that $T^2=T$, the answer is: yes, they are called projection matrices (well, they are idempotent matrices, but let's keep it simple.) See Wikipedia: For example, the function which maps the point $(x, y, z)$ in three-dimensional space $\mathbb{R}^3$ to the point $(x,y,0)$ is an orthogonal projection onto the $x–y$ plane. This function, $T(x,y,z)=(x,y,0)$, is represented by the matrix:
$$P=\begin{bmatrix}1&0&0\\0&1&0\\0&0&0\end{bmatrix}$$ 
and you can easily verify that $PP=P$ (if you project a vector and then project its projection, you get the same projection.)
Let me say that the eigenvalues of a projection matrix must be $0$ or $1$. As you'll see later, this is why $\det(P)=\det(PP)=0$ or $1$.
More examples:
$$T(x,y,z)=(x+z,y+z,0), P=\begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}$$
$$T(x,y,z)=(-z,-z,z), P=\begin{bmatrix} 0 & 0 & -1 \\ 0 & 0 & -1 \\ 0 & 0 & 1 \end{bmatrix}$$
In general, if $X$ is a full rank matrix then $P=X(X^TA)^{-1}X^T$ is a projection matrix, e.g.
$$X=\begin{bmatrix} 1 & 1 \\ 1 & 2 \\ 1 & 3 \end{bmatrix},\;P=X(X^TA)^{-1}X^T=\begin{bmatrix} 5/6 & 1/3 & -1/6 \\ 1/3 & 1/3 & 1/3 \\ -1/6 & 1/3 & 5/6\end{bmatrix},\;PP=P$$
