Let $\mathcal{H}$ be a complex Hilbert space and $\mathcal{B}(\mathcal{H})$ be the algebra of all bounded linear operators on $\mathcal{H}$.
Theorem: Let $T\in \mathcal{B}(\mathcal{H})$, then $W(T)$ is a convex subset of $\mathbb{C}$, where $$W(T):=\{\langle T x\mid x\rangle;\;x \in \mathcal{H}\;\;\text{with}\;\|x\|=1\}.$$
Proof: Given $\lambda,\mu\in W(T)$ such that $\lambda\neq\mu$ and we will prove that $\eta=t\lambda+(1-t)\mu \in W(T)$ whenever $t\in [0,1]$. Clearly we have $$\eta\in W(T)\Leftrightarrow t\in W(\alpha I+\beta T),$$ with $\alpha=-\frac{\mu}{\lambda-\mu}$ and $\beta=\frac{1}{\lambda-\mu}$. Let $S=\alpha I+\beta T$. We observe that $\eta\in W(T)$ if and only if $t\in W(S)$ for all $t\in [0,1]$. Since $\lambda,\mu\in W(T)$, then there exist unit vectors $x,y\in \mathcal{H}$ such that $$\lambda=\langle Tx\mid x\rangle\;\text{and}\;\mu=\langle Ty\mid y\rangle.$$ A simple calculation shows that $$\langle Sx\mid x\rangle=1\;\text{and}\;\langle Sy\mid y\rangle=0.$$ Define $g:\mathbb{R}\to \mathbb{C}$ by $$g(\theta)=\langle Sy\mid x\rangle e^{-i\theta}+\langle Sx\mid y\rangle e^{i\theta},\;\theta\in \mathbb{R}.$$ Obviously $g(\theta+\pi) = -g(\theta)$ for all $\theta\in \mathbb{R}$. Further, $\Im m g(0)=-\Im m g(\pi)$. Since $g$ is a continuous function, then there exists $\theta_0\in [0,\pi]$ such that $\Im m g(\theta_0)=0$.
Now observe that the vectors $y$ and $\hat{x}=e^{i\theta_0}x$ are linearly independent. Otherwise, we write $y=\alpha \hat{x}$ for some $\alpha\in \mathbb{C}$, then $|\alpha|=1$ and $0=\langle Sy\mid y\rangle=|\alpha|^2\langle S\hat{x}\mid \hat{x}\rangle=\langle Sx\mid x\rangle=1$ which is a contradiction. Hence, $\|(1-t)y+t\hat{x}\|\neq 0$ for all $t\in [0,1]$. Put $$z_t=\frac{(1-t)y+t\hat{x}}{\|(1-t)y+t\hat{x}\|},\;t\in [0,1].$$ Clearly $\|z_t\|=1$ for all $t\in [0,1]$. Moreover, one can see that $\langle Sz_0\mid z_0\rangle=0$ and $\langle Sz_1\mid z_1\rangle=1$. This implies that $0,1\in W(S)$.
To finish the proof, define a continuous function $f$ on $[0,1]$ by $$f(t)=\langle Sz_t\mid z_t\rangle,\;t\in [0,1].$$ A straightforward calculation shows that $f$ is a real-valued function with $f(0)=0$ and $f(1) = 1$. Hence $[0,1]\subset W(S)$.
In this proof I don't understant the following facts:
$\eta\in W(T)\Leftrightarrow t\in W(\alpha I+\beta T).$
Why we use $\Im m g$ in order to find $\theta_0$.
Why we use $f$ in order to conclude that $[0,1]\subset W(S)$?