Motivation: If we have some real function $f$ defined on an interval $I$ and $D=\operatorname{diag}(\lambda_1,\ldots,\lambda_n)$ is a diagonal matrix such that $\lambda_i \in I$ for all $1\leqslant i \leqslant n$, then we define $$f(D)=\operatorname{diag}(f(\lambda_1),\ldots, f(\lambda_n)).$$ If $A$ is Hermitian matrix whose eingenvalues $\lambda_j$ are in $I$, we than can choose unitary matrix $U$ such that $A=UDU^*$, where $D$ is diagonal, and then we define $f(A)=Uf(D)U^*$.
My question: suppose that now $A$ is some self-adjoint operator on some separable infinite-dimensional Hilbert space $H$. I know that for continuous function $f$ (but this can be done for Borel measurable function, but we will stick with continuous functions) defined on some interval $I$ and self-adjoint (but it's also true for normal operators) operator $A \in B(H)$ such that $\sigma(A) \subset I$ we define $$f(A) = \int_{\sigma(A)} f(t)\, dE(t)$$ where $E$ is spectral measure associated with $A$, that is $A=\displaystyle\int_{\sigma(A)} t\, dE(t)$.
I am wondering, if we have some operator $T \in B(H \oplus H)$ defined with $T=\begin{bmatrix}A & 0 \\ 0 & B\end{bmatrix}$ where $A$ and $B$ are self-adjoint operator such that $\sigma(A),\sigma(B) \subset I$ and if $f$ is continuous function on $I$, do we then have $$f(T)=\begin{bmatrix}f(A) & 0 \\ 0 & f(B)\end{bmatrix}$$ Also, if $X=U^* T U$ where $U$ is some unitary operator, do we then have $f(X)=U^* f(T) U$?
Basically, I am wondering are they true generalizations from matrix case? If yes (which I strongly believes), how can we prove it?
Yes. The functional calculus preserves approximation by polynomials. So, from $$ T^n=\begin{bmatrix}A^n&0\\0&B^n\end{bmatrix}, $$ you get that $$ p(T)=\begin{bmatrix}p(A)&0\\0&p(B)\end{bmatrix} $$ for any polynomial $p$. Now using a sequence of polynomials that converges uniformly to $f$, you get that $$ f(T)=\begin{bmatrix}f(A)&0\\0&f(B)\end{bmatrix}. $$ For a unitary, a similar reasoning applies. You have $X^n=UT^nU^*$ for all $n$, so $p(X)=Up(T)U^*$ for all polynomials, and by taking limits you deduce that $f(X)=Uf(T)U^*$.