Show that both $m=\inf\limits_{||x||=1}\langle Ax,x\rangle$ and $M=\sup\limits_{||x||=1}\langle Ax,x\rangle$ are eigenvalues if they are nonzero 
Let A be a compact and self-adjoint operator on a Hilbert space $H$. Let $m=\inf\limits_{||x||=1}\langle Ax,x\rangle$ and let $M=\sup\limits_{||x||=1}\langle Ax,x\rangle$. Show that if both $m$ and $M$ are nonzero then both of them are eigenvalues. 

I was able to show that at least one of these will be an eigenvalue, but I haven't figured out how to show that both are eigenvalues. Here is what I have done so far. 
We know that $-||A|| \le m \le \lambda_i \le M \le ||A||$, where $\lambda_i$ is any eigenvalue of $A$. Also, since $A$ is compact and self-adjoint we also know that at least one of the numbers $-||A||$ or $||A||$ is an eigenvalue. Without loss of generality if $||A||$ is an eigenvalue then we get that $M=||A||$ which shows that $M$ is an eigenvalue, but then I am unable to say anything about $m$ unless I make the assumption that $-||A||$ is also an eigenvalue which I think I can't do. 
Any help is appreciated.
 A: Because $A$ is compact and selfadjoint, we have $m\leq0\leq M$, and the Spectral Theorem tells you that 
$$
A=\sum_{n}\lambda_{n}P_n+\sum_{n}\lambda_{-n}Q_n,
$$
where for all $n$ $\lambda_n\in\mathbb R$, $\lambda\geq0$, $\lambda_{-n}<0$, and $P_n,Q_n$ are rank-one projections; and $\lambda_n\searrow0$, $\lambda_{-n}\nearrow0$. Take $\{x_n\}_{n\in\mathbb N}$ and $\{y_n\}_{n\in\mathbb N}$ with $\|x_n\|=\|y_n\|=1$, $P_nx_n=x_n$, $Q_ny_n=y_n$; since $A$ is selfadjoint, these two sequences are orthogonal. Now for any $x\in H$ with $\|x\|=1$, $x=\sum_n\alpha_nx_n+\sum_n\beta_ny_n$, $\sum_n|\alpha_n|^2+|\beta_n|^2=1$, and 
$$
\langle Ax,x\rangle=\sum_n\lambda_n|\alpha_n|^2+\sum_n\lambda_{-n}|\beta_n|^2\leq\sum_n\lambda_1|\alpha_n|^2+\sum_n\lambda_{1}|\beta_n|^2=\lambda_1. 
$$
So $M\leq \lambda_1$, and since $\lambda_1=\langle Ax_1,x_1\rangle\leq M$, we conclude that $M=\lambda_1\in \sigma(A)$. 
Working with $-A$, we obtain that $-m\in\sigma(-A)=-\sigma(A)$, so $m\in\sigma(A)$. 
So whenever one of $M,m$ is nonzero, it is an eigenvalue. 
