I need to prove that the linear map $T \colon \mathbb{R}^n \to \mathbb{R}^n$, which is represented by the matrix $A=\left[\frac{1}{n} \right]_{ij}$ (in the standard basis) is the linear projection, and I also have to find the matrix $P$ which diagonalizes $A$.
Proving that $T$ is the projection operator is easy because $A^2=A$ and so $T^2=T$. Now, $P$ must have $n$ linearly independent eigenvectors as its columns. $T$ can only have two eigenvalues - $0$ or/and $1$.
I showed that $\operatorname{Im}(T)=\operatorname{span}(\{(\frac{1}{n},...,\frac{1}{n})\})$ (so the basis of $\operatorname{Im}(T)$ is $\{(1,1,\dots,1)\}$). Because $T$ is the projection onto $\operatorname{Im}(T)$ along $\operatorname{Ker}(T)$, and because for every $v \in \operatorname{Im}(T)$, $T(v)=v$ we conclude that all the vectors in $\operatorname{Im}(T)$ are eigenvectors corresponding to the eigenvalue $1$. My problem is with the $\operatorname{Ker}(T)$. I simply can't understand why, for example, the vector $(1,0,...,0,-1)$ can be a basis vector of $\operatorname{Ker}(T)$ while $(1,0,...,0,1)$ can't. In other words, why:
$$T(1,0,...,0,-1)=0$$
and
$$T(1,0,...,0,1) \neq 0$$
(According to the answers, the following $n-1$ vectors are a basis of $\operatorname{Ker}(T)$: $$(1,0,...,0,-1)\\(1,0,...,0,-1,0)\\ \vdots \\(1,-1,0,...,0)$$ because the projection of all of them onto $\operatorname{Im}(T)$ is $0$ and thus
$$P=\begin{bmatrix} 1 & 1 & \dots & 1 & 1 & 1\\ 0 & 0 & \dots & 0 & -1 & 1\\ 0 & 0 & \dots & -1 & 0 & 1\\ \vdots & \vdots & & \vdots & \vdots & \vdots\\ 0 & -1 & \dots & 0 & 0 & 1 \\ -1 & 0 & \dots & 0 & 0 & 1 \end{bmatrix}$$).
Observe that $T$ is the averaging operator. It sends a vector to its mean: $$ v=(v_1,\cdots,v_n)\mapsto Tv=\frac{\displaystyle\sum_{i=1}^n v_i}{n} $$ The kernel is the set of vectors with $Tv=0$, which is equivalent to $v$ having mean 0.
Since $(1,\cdots,0,\cdots,-1)$ has mean 0, it lies in the kernel. On the other hand, $(1,\cdots,0,\cdots,1)$ has mean $2/n$ so it does not lie in the kernel.
Does that make sense?