Let $A$ be a bounded self-adjoint operator on some Hilbert space $\mathcal H$. Assume $A^2\leq A$, meaning that $\langle A^2v,v\rangle\leq\langle Av,v\rangle$ for all $v\in\mathcal H$. I am wondering whether or not I can conclude that $$ 0\leq A\leq 1,\qquad\mbox{meaning that $0\leq\langle Av,v\rangle\leq\langle v,v\rangle$ for all $v\in\mathcal H$.} $$
I came up with two approaches.
Use the partial fraction decomposition $$ \frac{2A-1}{A(1-A)-\lambda(1-\lambda)}=\frac 1{\lambda-A}+\frac 1{\lambda-(1-A)} $$ and the fact that $A^2\geq 0$, so that $A\geq A^2\geq 0$ by assumption; hence if $\lambda<0$ the operator $\frac 1{\lambda-A}$ is bounded and so also is $$ \frac 1{\lambda-(1-A)}=\frac{2A-1}{A(1-A)-\lambda(1-\lambda)}-\frac 1{\lambda-A} $$ implying that $1-A\geq 0$, i.e. $A\leq 1$.
Resort to the Spectral Theorem and functional calculus: call $\sigma(A)\subseteq\mathbb R$ the spectrum of $A$ and $d\mu_A$ the spectral measure of $A$, so that $$ f(A)=\int_{\sigma(A)}f(\lambda)d\mu_A(\lambda). $$ Hence $$ A^2-A=\int_{\sigma(A)}(\lambda^2-\lambda)d\mu_A(\lambda), $$ so that, at least heuristically, the assumption that $A^2-A\leq 0$ implies $\lambda^2-\lambda\leq 0$ on the spectrum of $A$, and so $\sigma(A)\subseteq[0,1]$, and so $0\leq A\leq 1$.
Are they good? In general if $f(A)\geq 0$, is it true that $\sigma(A)\subseteq f^{-1}([0,+\infty))$? With what condition on $f$ (for instance, $f$ an entire function which is real on the real axis)?
This may be very basic, but I am not so familiar with the methods of Operator Theory :)
Well, I would avoid calculus-inspired operator computations as in your first solution, and I am not confident enough on functional calculus to state about your second solution.
But here is an elementary proof (with $I$ the indentity operator):
As $$\langle A(A-I) v,v\rangle\leq0,$$ it follows that $$\langle A(A-I) v,v\rangle-\langle (A-I) v,v\rangle\leq-\langle (A-I) v,v\rangle,$$ but the self-adjointness of $A$ gives $$\begin{align*}\langle A(A-I) v,v\rangle-\langle (A-I) v,v\rangle&=\langle (A-I) v,Av\rangle-\langle (A-I) v,v\rangle\\&=\langle (A-I) v,(A-I)v\rangle\geq 0.\end{align*}$$ Hence, $$\langle (A-I) v,v\rangle\leq 0$$ which gives what you desire.
And: $0\leq \langle Av,Av\rangle= \langle A^2v,v\rangle\leq \langle Av,v\rangle$ gives the positivity...