Property of a wavefunction We know that a wavefunction can't be completely real, because then it would have some complex expectation values for some operators. If we let $\psi$ be a real wavefunction, then
$$\langle P\rangle= \int{\psi^*\left(-i\hbar \frac{\partial}{\partial x}\right) \psi\, dx}$$
would be imaginary, which is not allowed.
Just like this, can a wavefunction be completely imaginary?
I think it won't be possible, because then the $i$ will cancel out, and the expectation will be again imaginary.  Am I right or wrong?
And I also want to know why an operator can't have imaginary expectation value?
 A: If $\psi(x)$ is a "completely real" wavefunction, then $\phi(x) \equiv i \psi(x)$ is an "completely imaginary" wavefunction that is experimentally indistinguishable from $\psi(x)$.  This is because multiplying a wavefunction by an overall phase of $i = e^{i \pi/2}$ does not change the results of any experiment.  So any statement you can make about expectation values of "completely real" wavefunctions can be made about "completely imaginary" wavefunctions as well.
A: The only constraint on a particle's wavefunction $\psi$ is that it must be square-integrable - i.e. $\int_{-\infty}^\infty \overline{\psi(x)} \psi(x) \mathrm dx < \infty$.  So it's perfectly possible to have an entirely $\mathbb R$-valued wavefunction, or an entirely imaginary ($i\mathbb R$-valued) wavefunction, or neither.  Additionally, given an arbitrary operator $\mathcal O$, the expected value
$$\langle\mathcal O\rangle_\psi = \langle \psi,\mathcal O\psi\rangle$$
is generally $\mathbb C$-valued and need not belong to $\mathbb R$.
However if $\mathcal O$ happens to be self-adjoint so that $\mathcal O^\dagger = \mathcal O$, it's easy to see that the expected value must be real:
$$\langle \mathcal O\rangle_\psi = \langle \psi,\mathcal O\psi\rangle = \langle \mathcal O\psi,\psi\rangle = \overline{\langle \psi,\mathcal O \psi\rangle} = \overline{\langle \mathcal O\rangle_\psi}$$
where the line denotes complex conjugation and we've used the fact that for self-adjoint operators, $\langle \psi,\mathcal O\phi\rangle = \langle\mathcal O\psi,\phi\rangle$.

For your example of the momentum operator for a particle on a line $P = -i \frac{d}{dx}$ and a wavefunction $\psi$ which is $\mathbb R$-valued, we have
$$\langle P\rangle_\psi = -i\int_{-\infty}^\infty \overline{\psi(x)}\psi'(x) \mathrm dx $$
which is $i$ multiplied by a manifestly real number. However, we are saved by the fact that if $\psi$ is real then $\overline{\psi(x)}=\psi(x)$ and so we have
$$\langle P\rangle_\psi = -i\int_{-\infty}^\infty \overline{\psi(x)}\psi'(x) \mathrm dx  = -i \int_{-\infty}^\infty \frac{1}{2}\frac{d}{dx}\big(\psi(x)\big)^2 \mathrm dx = -\frac{i}{2} \big[\psi(\infty)^2 -\psi(-\infty)^2\big]$$
$$ = 0$$
Therefore, if $\psi$ is purely real then $\langle P\rangle_\psi=0$.
