Do expectation values over all possible states uniquely specify an operator? Suppose I have two operators $A$ and $B$ which each obey $\langle\psi|A|\psi\rangle = \langle\psi|B|\psi\rangle$ for all elements $|\psi\rangle$ of the space. Does this imply $A=B$? I remember seeing a proof on Stack Exchange way back when but can't seem to dig it up now.
That $\langle\psi_1|A|\psi_2\rangle = \langle\psi_1|B|\psi_2\rangle$ for all elements $|\psi_{1/2}\rangle$ is sufficient to conclude $A=B$ is clear from considering a particular basis as the $|\psi_{1}\rangle$, but obviously this is a stronger condition (at first glance) than the former.
Bonus points (generalizing from pure states): Does $\operatorname{trace}\{A \rho\} = \operatorname{trace}\{B\rho\}$ for all valid (density/state) operators $\rho$ ($\rho$ nonnegative, of unit trace, and self-adjoint) imply that $A=B$? Obviously answering this (in the affirmative) answers the first question, so please feel free to just answer this.
Edited to include an image describing the operator. Image included as I'm not sure how to describe the velocity opreator $\textbf{V}$ which Ballentine defines.

 A: Assume for simplicity that the operators $A,B$ are bounded so we don't run into any domain issues. Note that
$$\langle \psi\pm\phi,A(\psi\pm\phi)\rangle = \langle \psi,A\psi\rangle + \langle \phi,A\phi\rangle \pm \langle \psi,A\phi\rangle \pm \langle \phi,A\psi\rangle$$
$$\langle \psi\pm i\phi,A(\psi\pm i\phi)\rangle = \langle \psi,A\psi\rangle + \langle \phi,A\phi\rangle \pm i\langle \psi,A\phi\rangle \mp i \langle \phi,A\psi\rangle$$
A bit of algebra yields that
$$4\langle \psi,A\phi\rangle = \langle \psi+\phi,A(\psi+\phi)\rangle - \langle \psi-\phi,A(\psi-\phi)\rangle $$
$$-i \bigg[\langle \psi+i\phi,A(\psi+i\phi)\rangle -  \langle \psi-i\phi,A(\psi-i\phi)\rangle\bigg]$$
This is an example of a so-called polarization identity.  Your desired result follows straightforwardly from here.

Bonus points (generalizing from pure states): Does $\operatorname{trace}\{A \rho\} = \operatorname{trace}\{B\rho\}$ for all valid (density/state) operators $\rho$ ($\rho$ nonnegative, of unit trace, and self-adjoint) imply that $A=B$?

Yes, but you have it backwards - this is a weaker statement than the first one. If $\mathrm{Tr}(A\rho)= \mathrm{Tr}(B\rho)$ for all density operators $\rho$, than in particular it holds for all pure states $\rho= |\psi\rangle\langle \psi|$, at which point the argument above takes over.  In other words, we don't need to assume the equality holds for all density operators - the set of pure density operators suffices.
