Prove that if $A$ is diagonalizable then there is a matrix $B$ such that $B^{2012} = A$
Solution 1:
The crucial step is that if you have a matrix of the form $ABA^{-1}$ and you take some power of it, this is equal to $(ABA^{-1})^n=AB^nA^{-1}$.
In the case you mention, you have $A=PDP^{-1}$. If you define $\tilde{D}$ to be the one obtained from $D$ by replacing every $\lambda_i$ by $\sqrt[2012]{\lambda_i}$ (where the choice of root doesn't really matter), this results in $(P\tilde{D}P^{-1})^{2012} = P\tilde{D}^{2012}P^{-1} = PDP^{-1}=A$ and so $B=P\tilde{D}P^{-1}$ would solve your question.
Solution 2:
Consider $B = P D_1 P^{-1}$ such that $$ D_1 = \left ( \begin{array} {cccc} \lambda_1^{\frac 1{2012}} & 0 & \cdots & 0\\ 0 & \lambda_2^{\frac 1{2012}} & \cdots & 0\\ \vdots & \ddots & \vdots & \vdots \\ 0 & \cdots & 0 & \lambda_n^{\frac 1{2012}} \end{array}\right) $$ then $$ B^{2012} = PD_1^{2012}P^{-1} = PDP^{-1} $$ where $$ D = \left ( \begin{array} {cccc} \lambda_1 & 0 & \cdots & 0\\ 0 & \lambda_2 & \cdots & 0\\ \vdots & \ddots & \vdots & \vdots \\ 0 & \cdots & 0 & \lambda_n \end{array}\right) $$