Unitary operator algebra and multiplying by identity If $\hat{H}$ is Hermitian, with eigenvalues $a_k$, then $$\hat{H} = \sum_k a_k \left|\psi_k\right> \left<\psi_k\right|.$$
I read that it then follows that
$$\begin{align*}
e^{i\hat{H}} = \sum_k e^{i a_k} \left|\psi_k\right> \left<\psi_k\right|
\end{align*}$$
I don't understand how the substitution for $\hat{H}$ has worked here. Why is it acceptable for only $a_k$ to have taken the place of $\hat{H}$ in the exponent, with the rest just multiplied (and not in the exponent as well)?
Also, why is $\left|\psi_k\right>\left<\psi_k\right|$ included in the definition, when all it amounts to is multiplying by the identity?
 A: For finite dimensions, this is by definition. Note that $|\psi_k\rangle \langle \psi_k|$ is a rank-one projection, i.e. $(|\psi_k\rangle\langle \psi_k|)^2=|\psi_k\rangle\langle \psi_k|$. Now plug in the definition of the exponential for operators:
$$ e^{iH}=\sum_{n=0}^\infty \frac{(\sum_k ia_k |\psi_k\rangle\langle \psi_k|)^n}{n!} =\sum_{n=0}^\infty \sum_k \frac{(ia_k)^n}{n!} |\psi_k\rangle\langle \psi_k| = \sum_k e^{ia_k}|\psi_k\rangle\langle \psi_k|$$
where we used orthogonality and the projector identity. Also note that we do not multiply with the identity. This would be $\sum_k e^{ia_k} \sum_k |\psi_k\rangle\langle \psi_k|$, bue we only have one sum. Basically, this is just the spectral decomposition of the exponentiatet operator.
For infinite dimensional spaces (let's assume bounded operators only for sake of simplicity), this is by construction: You often define the functional calculus for self-adjoint operators via the spectral decomposition, i.e. if 
$$ A=\int_{\sigma(A)} \lambda \,dE(\lambda) \left(=\sum_k a_k |\psi_k\rangle\langle \psi_k|\right)$$
is the spectral decomposition, where the second equality holds only for compact operators, then if it makes sense to define a function $f$ on the operator (bounded functions are fine for instance), then you define it via:
$$ f(A)=\int_{\sigma(A)} f(\lambda) \,dE(\lambda) \left(=\sum_k f(a_k) |\psi_k\rangle\langle \psi_k|\right)$$
Plugging in the exponential, which turns out to be fine, you get the required result. 
A: The easiest thing is to think of the finite-dimensional case, e.g. a $2\times 2$ matrix. In this case
$$H = \begin{bmatrix}a_1&0\\0&a_2\end{bmatrix}$$
and clearly
$$e^{iHt} = \begin{bmatrix}e^{ia_1t}&0\\0&e^{ia_2t}\end{bmatrix}$$
which can be justified by the Maclaurin series expansion of the exponential function.
For more general cases the result follows from functional calculus in conjunction with the spectral decomposition, which applies to, e.g., even unbounded (essentially) self-adjoint operators, as in the case of the QHO.

...when all it amounts to is multiplying by the identity?

I don't quite get this last bit. Those dyadic expression are rank-1 projections onto (1 dimensional subspaces of) the corresponding eigenspaces and when multiplied by something that is not 1 their sum won't give you the identity operator.
