In other words, I want to prove that if $\Im(\lambda)>0$, then for every $y\in X$ there exists $x\in X$, such that $(\lambda I-A)x=y$. How to go about proving that? (I assume this statement is correct but if it's wrong please correct me)
My attempt is as follows:
To use the property of the space $X$ being Hilbert, I make both parts of this equation inner products:
$\langle (\lambda I-A)x,y\rangle =\langle y,y\rangle=||y||_X^2$.
Then I would want to use the fact that the imaginary part of the left hand side is $0$:
$\Im(\langle \lambda x,y\rangle)=\Im(\langle Ax,y\rangle)$.
I suppose $\Im(\lambda )=0$, and want to come to contradiction:
$\Im(\langle x,y\rangle)=\Im(\langle Ax,y \rangle)$ (for every $y\in X$).
I'm not sure what to do next and whether I've done anything useful. I also make no use of linearity of $X$.
My question is part of the question (Spectrum of self-adjoint operator on Hilbert space real), but I don't understand the proof there.
What you are attempting to show is that every bounded linear operator on a Hilbert space has real spectrum. In the finite-dimensional case, this amounts to saying that every linear map $\mathbb{C}^n \to \mathbb{C}^n$ has only real eigenvalues. This is false. Take, for example, take the operator $T: \mathbb{C} \to \mathbb{C}$ to be multiplication by $i$: $z \mapsto i z$. Then $T - i I = 0$, so $T - i I$ is not surjective.
The standard example of sufficient conditions for an operator on a Hilbert space to have real spectrum is that $A$ be self-adjoint, which is to say $\langle Ax, y\rangle = \langle x, A y \rangle$ for all $x$ and $y$.