Let $ f: A \to B $ be a linear map between two $ C^* $ algebras.
What is a sufficient condition to guarantee that the linear map $ f $ takes the identity to the identity $ f(1_A)=1_B $?
For example, taking $ A=B=\mathbb{C}^{2 \times 2} $ the algebra of $ 2 \times 2 $ matrices. Is it sufficient for $ f $ to be positive and trace preserving?
Being positive alone is not sufficient since the map $ M \mapsto 2M $ is positive but not unital. Being trace-preserving alone is not sufficient since the map $ \begin{bmatrix} a & b \\ c & d \end{bmatrix} \mapsto \begin{bmatrix} a+d & b \\ c & 0 \end{bmatrix} $ is trace preserving but not unital.
I'm guessing I don't need to assume complete positivity since the transpose map $ M \mapsto M^T $ is not completely positive but it is positive and trace preserving and it happens to be unital. https://en.wikipedia.org/wiki/Completely_positive_map
No, a positive trace-preserving map is not necessarily unital. For example, the map $$ M_n(\mathbb C)\to M_n(\mathbb C),\,A\mapsto \operatorname{tr}(A)\sigma $$ is positive (in fact completely positive) and trace-preserving if $\sigma$ is positive and $\operatorname{tr}(\sigma)=1$. But it is only unital if $\sigma=1/n$.
The closest result I can think of is that a linear map $\Phi\colon M_m(\mathbb C)\to M_n(\mathbb C)$ is unital if and only if the Hilbert-Schmidt adjoint $\Phi^\dagger$ defined by $$ \operatorname{tr}(\Phi^\dagger(A)^\ast B)=\operatorname{tr}(A^\ast\Phi(B)),\qquad A\in M_n(\mathbb C),\,B\in M_m(\mathbb C), $$ is trace-preserving. However, this is a pretty direct consequence of the definition.
Abstractly, this criterion just says that a bounded linear map $\Phi\colon A\to B$ between $C^\ast$-algebras is unital if and only if $\Phi^\ast(\psi)(1)=\psi(1)$ for all $\psi\in B^\ast$, which is a simple consequence of Hahn-Banach.