$\det(A+tB)=\det(f(A)+tf(B))$ Let $f:\mathcal{M}_n(\mathbb{C})\longrightarrow\mathcal{M}_n(\mathbb{C})$ a surjective function such that for all $A,B\in\mathcal{M}_n(\mathbb{C})$ and for all $t\in\mathbb{C}$, 
$$ \det(A+tB)=\det(f(A)+tf(B)) $$
How can one show that $f$ is bijective and that $\mathrm{rank}(f(A))=\mathrm{rank}(A)$ for all $A\in\mathcal{M}_n(\mathbb{C})$?
 A: Then, for all matrices $A$, and all complex numbers $t$, $\det(f(A)+tf(0_n))=\det(A)$. Since $f$ is surjective, in particular, $\det(I+tf(0_n))$ is constant. This implies $f(0)$ nilpotent. 
Now, if $f(0_n)$ is nonzero, we have a non-invertible matrix $M=f(M_1)$ such that $M+f(0_n)$ is invertible. Then $f(M_1)$, $M_1$, $M_1+0_n$, and $f(M_1)+f(0_n)$ have the same determinant, which must be both zero and nonzero. So $f(0_n)=0_n$. 
As a consequence, $f(I_n)$ has determinant $1$, so we can replace $f$ with $f_1(M)=f(I_n)^{-1}f(M)$ and thus assume $f(I_n)=I_n$. 
Thus $f(A)$ and $A$ have the same characteristic polynomial for all $A$. 
In particular, a matrix is invertible iff its image is invertible. 
Assume that $A_1$ and $A_2$ have the same image. Then for all matrices $B$, $A_1+B$ and $A_2+B$ have the same determinant. So with $D=A_2-A_1$, for all matrices $B$, $B$ and $B+D$ have the same determinant. By a similar argument to the “$f(0_n)=0_n$” it follows that $D=0$, thus $f$ is injective. 
Note then that for all matrices $f(A)$ and $B$, $f(tB)+f(A)$ and $tf(B)+f(A)$ have the same determinant, so, by the same argument and since $f$ is surjective, $f(tB)=tf(B)$. 
The rest follows from the following lemma: let $A$ be a matrix, and consider, for any matrix $B$, the map $\delta_B(t)=\det(A+tB)$. Then the dimension of the kernel of $A$ is the greatest integer $k$ satisfying: for all $B$, $\delta_B$ is a polynomial of which $0$ is a root of multiplicity at least $k$. 
A: For the first part, as Mindlack observes, if $A_1\ne A_2$, let $P$ be any nonsingular matrix such that $P+A_2-A_1$ is singular. Put $B=P-A_1$. Then
$$
\det\left(f(A_1)+f(B)\right)=\det(A_1+B)=\det(P)\ne0=\det(A_2+B)=\det\left(f(A_2)+f(B)\right).
$$
Hence $f(A_1)\ne f(A_2)$ and $f$ is injective. In turn, $f$ is bijective.
Incidentally, the second part of the question (about the preservation of matrix rank by $f$) is reminiscent of another examination problem in French. So, for fun, we may use similar techniques to those employed in that question to solve our problem. More specifically, we make use of the following two properties of singular matrices that hold over any field:


*

*Let $B\in M_n$. Then $\det(A+tB)$ is a degree-$n$ polynomial in $t$ for every matrix $A$ if and only if $B$ is nonsingular.

*Let $B\in M_n$ be a singular matrix and $0\le r<n$. Then there exists a matrix $A$ (whose choice depends on $B$ and $r$) such that $\det(A+tB)$ is a degree-$r$ polynomial in $t$ if and only if $\operatorname{rank}(B)\ge r$.


Since $f$ is bijective, the identity $\det(X+tY)=\det\left(f^{-1}(X)+tf^{-1}(Y)\right)$ also holds. Now property 1 above implies that both $f$ and $f^{-1}$ map nonsingular matrices to nonsingular matrices (and hence they also map singular matrices to singular matrices). For singular matrices, property 2 implies that $\operatorname{rank}(B)\ge r$ if and only if $\operatorname{rank}\left(f(B)\right)\ge r$. Consequently, $B$ and $f(B)$ have the same ranks.
