Let $A \colon X \to X$ be a compact, self-adjoint operator that is linear as well, on the real Hilbert space $X$. Let $R \colon X \setminus\{0\} \to \mathbb{R}$ be defined as $R(x) = ( Ax, x)_X$ for $\| x \| = 1$. (better known as the Rayleigh-quotient).
We can assume that $A$ is non-negative, that is $R(x) \geq 0$ and $\sup_{x} R(x) > 0$ and that $\| A \| = \sup_{x \in X \setminus\{0\}} R(x)$. Previously, I showed that $R$ is bounded (Cauchy-Schwarz, quite easy).
I want to show that there exists $x_0$ so that $R(x_0) = \sup_{y} R(y)$.
The difficulty seems to be that a compact operator maps bounded sets to relatively compact sets. I tried to show that the image is closed using that, unsuccessfully. Working with limits wasn't conclusive either, due to the image not being necessarily closed. Another option I considered was using that for any $f\colon X \to Y$ continuous, $X$ compact, $Y$ Hausdorff implies $f$ closed (mapping closed sets to closed sets), but I could not show that the unit circle is compact in $X$. Can someone post any hint how to get to this conclusion?
This problem occurs in a proof about the spectral theorem, so any hint relying on results of this fact are unhelpful.