On this Wikipedia page, it says that
$$f(A) = Qf(\Lambda)Q^{-1}$$
where $\Lambda$ is a diagonal matrix with the eigenvalues of $A$ on the diagonal, and $Q$ is the eigenvector matrix. In other words, they the eigendecomposition of $A$, such that $A=Q\Lambda Q^{-1}$. Why is equation above true? Why are we able to pull out the eigenvector matrix this way?
Edit: I have tried to find proof. The closest thing I could find is a definition in a book, which states it as if it is a fact. It is not an assignment, only something I fail to see why it works. I genuinely would like to understand. Please don't downvote the question to oblivion.
Inspired by this answer to another question, here is my solution. Please correct me if I am wrong.
The basic idea is to use Taylor expansion and the properties of $Q$.
Using Taylor series, we can expand the matrix function $f(A)$ as
$$ f(A) = f(0) + \frac{f'(0)}{1!}A + \frac{f''(0)}{2!}A^2 + \frac{f'''(0)}{3!}A^3 + ..... $$
In a more compact form,
$$ f(A) = \sum_{n=0}^\infty C_n A^n, $$
where coefficient $C_n$ is the $k_{\text{th}}$ derivative evaluated at $0$ divided by $n!$. Each component of the Taylor expansion is linearly independent to each other. For each element, we can show that
$$ A^n = Q(\Lambda^n)Q^{-1} $$
Therefore we have
$$ f(A) = \sum_{n=0}^\infty C_n Q(\Lambda^n)Q^{-1} = Q \big(\sum_{n=0}^\infty C_n\Lambda^n\big) Q^{-1} = Q f(\Lambda) Q^{-1}. $$