If the eigenvalues of a matrix $A$ are $0, 1$, is $A$ is projection? It's easy to prove that a projection has $0$ and/or $1$ as its eigenvalues.
My question is:

If a matrix has only $0$ and $1$ as its eigenvalues, does that mean that this matrix is a projection? (The zero and identity matrices are of no interest.)

 A: Consider (for any field $\Bbb F$) the linear transformation $\Bbb F^3 \to \Bbb F^3$ defined by the matrix $$A := \begin{pmatrix}0 & 1 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 1\end{pmatrix}.$$
Its eigenvalues are $0, 1$, but it is not a projection because $A^2 \neq A$, which is a consequence here of the nondiagonalizability of $A$. (This example is minimal in the sense that a square matrix with size $< 3$ with spectrum $\{0, 1\}$ is diagonalizable, hence equal to its own square.)
This fails for another reason in the real setting: Regarded as a linear transformation $\Bbb R^4 \to \Bbb R^4$, the real eigenvalues of the matrix
$$B := \begin{pmatrix} 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & -1 \\ 0 & 0 & 1 & 0\end{pmatrix}$$ are again $0, 1$, but again, $B^2 \neq B$, so $B$ is not a projection. (Regarded as a linear transformation $\Bbb C^4 \to \Bbb C^4$, this matrix has eigenvalues $0, 1, \pm i$.)
The issues in these two examples (respectively, nondiagonalizability and nonclosure of the base field) are, however, the only obstructions to our conjecture. More precisely, using the Jordan Canonical Form and the characterization that a linear transformation $P$ is a projection iff $P^2 = P$, one can quickly show the following:

(A linear transformation defined by) a matrix $A$ over an algebraically closed field is a projection iff it is diagonalizable and its only eigenvalues are $0, 1$.

A: Consider
\begin{align} A & = \begin{pmatrix} 1 & 1 & 0\\ 0 & 1 & 0\\ 0 & 0 & 0 \end{pmatrix} \end{align}
Then $A$ has eigenvalues $\lambda = 0$ with multiplicity $1$ and $\lambda = 1$ with multiplicity $2$.
Note that 
\begin{align} A^2 & = \begin{pmatrix} 1 & 2 & 0\\ 0 & 1 & 0\\ 0 & 0 & 0\end{pmatrix} \neq A\end{align}
means that $A$ is not a projection.
