In operator theory, we can prove that the commutant of $B(H)$ is $\mathbb{C} I$, where $I$ is the identity map. But a book states that every $C*$-subalgebra of $B(H)$ that contains the compact operators also has the commutant $\mathbb{C} I$. In the proof for $B(H)$, we don't need to use the properties of compact operators. What is the process of proof for every $C*$-subalgebra of $B(H)$ that contain the compact operators?
In the proof for $B(H)$, we use of the operator $T$ with this form: for fixed $x,y$ in $H$, $T_{x,y}(z)=\langle z,x\rangle y$. Is this operator compact?
Yes. Every finite-rank operator is compact.
More precisely, a closed and bounded set in a finite-dimensional vector space is compact (this is basically Heine-Borel). A finite rank operator is necessarily bounded, and so it maps closed balls into pre-compact sets, making it a compact operator.