I want to prove the following fact: let $A$ be a non-zero square matrix (matrix of an endomorphism in some basis) whose column vectors are the same, i.e. $A = \begin{pmatrix} a_1 & \dots & a_1 \\ \vdots & & \vdots \\ a_n & \dots & a_n \\ \end{pmatrix}$
then $A$ is diagonalizable $\iff$ $\sum_{i=1}^{n} a_i \neq 0$.
For the first implication I think it's easier to proceed by counterpositive. Suppose $a_1 + \dots + a_n = 0$. Let $A$ be the matrix of the endomorphism $f$ in some basis $B = \{e_1, \dots, e_n\}$. Then $e_2 - e_1, \dots, e_n - e_1 \in Ker(f)$ and clearly $e_1 \notin Ker(f)$. Therefore, dim($Ker(f)$) $= n-1$. I don't know how to proceed now or if this does even help. Besides, I obviously have tried to compute the characteristic polynomial: $p_A(\lambda) = (-1)^{n}x^{n-1}(x-\sum_{i=1}^{n}a_i)$ (not sure if it is correct but thoroughly checked). Since $a_1 + \dots + a_n = 0$, $p_A(\lambda) = (-1)^{n}x^n$, but what next?
Can someone give me some idea?
As you have mentioned, the dimension of the null space of $A$ is precisely $n-1$. The null space of $A$ is equivalent to the $0$-eigenspace of $A$. If $A$ is diagonalizable, then the algebraic multiplicity of 0 must equal its geometric multiplicity, which is $n-1$. You've noted that if $\sum_{i=1}^n a_i = 0$, then the characteristic polynomial is $(-1)^n x^n$, which would make the algebraic multiplicity of 0 equal to $n \neq n-1$. Thus, $\sum_{i=1}^n a_i = 0 \implies $ not diagonalizable.
If instead $\sum_{i=1}^n a_i \neq = C \neq 0$, then, again according to the characteristic polynomial you've found, $C$ is an eigenvalue of $A$ with algebraic multiplicity 1. Recall that the geometric multiplicity of an eigenvalue is at most its algebraic multiplicity; it follows that the geometric multiplicity of $0$ is $n-1$ and the geometric multiplicty of $C$ is $1$. These match the algebraic multiplicities, meaning that $A$ is diagonalizable. Thus, $\sum_{i=1}^n a_i \neq 0 \implies $ diagonalizable.
These two combine to give the desired biconditional.