Determine the rank of the linear map given by a $n \times n$ matrix , dependend on n. Proof by induction The task:
Let
$$
A:=
\begin{pmatrix}
1 & a & a & ...  & a\\
a & 1 & a & ... &a \\
a & a & ... & a  & a\\
... & ... &... & 1 & a
\\
a & a & a & a & 1
\end{pmatrix}
$$
a $ n \times n$ matrix / linear mapping. Determine the rank of A over $\mathbb{R}$ for $a\not= 1$.
What i have:
The rank is defined as $dim(Im(f))$. 
In our case our linear mapping maps $\mathbb{R}^n \rightarrow \mathbb{R}^n$
as $ dim V = dim (ker(f)) + dim (Im(f))$
we know that
$ n - dim(ker(f)) =  dim (Im(f)) = r_k (f)$
For n = 1 we have a matrix just containing 1, so the kernel will be trivial. So the rank for $n=1$ is $1-0 = 1$.
For n = 2 i wrote down
$$
\begin{pmatrix}
1 & a \\
a & 1 
\end{pmatrix}
$$ If you scale the first line by a and then substract the first from the second we have:
$$
\begin{pmatrix}
1 & a \\
0 & (1-a^2) 
\end{pmatrix}
$$
So i came to the conclusion that for $ a = \pm 1 $ the kernel will be one - dimensional, and the rank will be $2-1 = 1$
If $a\not= \pm 1  $ the kernel is trivial, so the rank is $2-0 = 2$.
I think that
\begin{equation}
   r_k(A) =
   \begin{cases}
     n  & \text{for } a\not= \pm 1  \\
     n -1 & \text{for } a= \pm 1  
   \end{cases}
\end{equation}
I want to prove it by induction now and here is where i am stuck: How can i show that for every n i will get the above result? 
 A: you can write this matrix as rank one perturbation of identity. that is $$ A = (1-a)I + auu^\top, u = (1,1,\cdots, 1)^\top.$$ it is not hard to verify that that $A$  has eigenvalues $$(1-a) +na, 1-a, 1-a, \cdots, 1-a$$ and the corresponding eigenvectors are $\{u, u^\perp\}.$  therefore the determinant of $A$ is $$(1-a)^{n-1}(1-a+na). $$
A: As $\det A=(1-a)^{n-1}\bigl(1+(n-1)a\bigr)$, which one can check by a direct row reduction, one sees that $\,\operatorname{rank} A=n\,$ if $a\neq 1, -\dfrac1{n-1}$.
It is also clearly equal to $1$ if $\,a=1$.
Claim: if  $a= -\dfrac1{n-1}$, $\,\operatorname{rank} A=n-1$.
Indeed, adding all above rows to the last one, then multiplying each row with $1-n$, you get the equivalent matrix:
$$\begin{bmatrix}
1-n&1&1&\dots&1&1\\
1&1-n&1&\dots&1&1\\
1&1&1-n&\dots&1&1\\
\vdots\\
1&1&1&\dots&1-n&1\\
0&0&0&\dots&0&0
\end{bmatrix}$$
All we have to prove is, for instance, the $(n-1)\times(n-1)$ minor:
$$\begin{vmatrix}
1&1&\dots&1&1\\
1-n&1&\dots&1&1\\
1&1-n&\dots&1&1\\
\vdots\\
1&1&\dots&1-n&1
\end{vmatrix}$$
is non-zero. But that is easy: substracting the last column from the $n-2$ first, one obtains:
$$\begin{vmatrix}
0&0&\dots&0&1\\
-n&0&\dots&0&1\\
0&-n&\dots&0&1\\
\vdots\\
0&0&\dots&-n&1
\end{vmatrix}=(-1)^{n-2}\begin{vmatrix}
-n&0&\dots&0\\
0&-n&\dots&0\\
\vdots\\
0&0&\dots&-n
\end{vmatrix}=n^{n-2}.$$
Summary:
$$A\enspace\text{has rank equal to}\enspace\begin{cases}
1&\text{if}\enspace n=1\\ 
n-1&\text{if}\enspace n=-\dfrac1{n-1}\\
n&\text{otherwise}
\end{cases}
$$
