Consider a smooth map $f$: $$ \begin{aligned} f: GL(2n,\mathbb{R})&\to GL(2n,\mathbb{R})\\ A&\mapsto AJA^{\text{T}}, \end{aligned} $$ where $$ J=\left( \begin{array}{cc} -I_n& \\ &I_n\\ \end{array} \right) $$is a $2n\times 2n$ matrix. Find the rank of $f$.
I have ever tried to calculate it by using the tangent map of $f$ to show the rank of $f$, because $\mathrm{rank}f_*= \mathrm{rank}f$. But I failed to write the representation of the linear map $f_*$. So, I will appreciate it if someone can give me an effective idea about this question.
Thanks.