Why is $\hat{p} \circ \hat{p}$ the operator corresponding to $p^2$? I understand from several heuristic arguments that in one dimension, the quantum-mechanical operator $\hat{p} = -i\hbar\,\partial_x$ corresponds to the classical momentum $p$, in the sense that a particle described by the wavefunction $\Psi(x,t)$ has expected momentum
$$ \langle p \rangle = \int_{-\infty}^\infty \Psi^* \hat{p} \Psi \,\mathrm{d}x. $$
Why does it then follow that the quantum-mechanical operator $\hat{p}^2 = \hat{p} \circ \hat{p}$ corresponds to the square of the classical momentum, $p^2$? In general,does the square of a classical quantity $q$ always correspond to the composition of its quantum-mechanical operator, $\hat{q}$, with itself? Does the same apply to higher powers of $q$, i.e. does the $n$-fold composition $\hat{q} \circ \hat{q} \circ \cdots \circ \hat{q}$ form the operator corresponding to $q^n$?
 A: Since $\hat{p}$ is a Hermitian operator, one can always expand the wave function $|\psi\rangle$ as a linear combination of the eigenstates of $\hat{p}$,
$$|\psi\rangle=\sum_{p}\psi(p)|p\rangle,$$
where the eigenstate $|p\rangle$ satisfies the equation $\hat{p}|p\rangle=p|p\rangle$. With this setup, we can first show $\langle\psi|\hat{p}|\psi\rangle=\langle p\rangle$ and then show $\langle\psi|\hat{p}\circ\hat{p}|\psi\rangle=\langle p^2\rangle$. Following is the math.
$$\begin{split}
\langle\psi|\hat{p}|\psi\rangle&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)\langle p_1|\hat{p}|p_2\rangle\\
&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)\langle p_1|p_2|p_2\rangle\\
&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)p_2\langle p_1|p_2\rangle\\
&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)p_2\delta_{p_1,p_2}\\
&=\sum_{p}\psi^*(p)\psi(p)p\\
&=\sum_{p}\rho(p) p\\
&=\langle p\rangle
\end{split}$$
Note that the square of the norm of the wave function $\psi^*(p)\psi(p)=|\psi(p)|^2=\rho(p)$ gives the probability distribution $\rho(p)$, and the last line is just the definition of the expectation value of the random variable $p$. The same deduction follows for $\langle p^2\rangle$.
$$\begin{split}
\langle\psi|\hat{p}\circ\hat{p}|\psi\rangle&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)\langle p_1|\hat{p}\circ\hat{p}|p_2\rangle\\
&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)p_2\langle p_1|\hat{p}|p_2\rangle\\
&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)p_2^2\langle p_1|p_2\rangle\\
&=\sum_{p_1}\sum_{p_2}\psi^*(p_1)\psi(p_2)p_2^2\delta_{p_1,p_2}\\
&=\sum_{p}\psi^*(p)\psi(p)p^2\\
&=\sum_{p}\rho(p) p^2\\
&=\langle p^2\rangle
\end{split}$$
One can see the above deduction can be generalized to any power, and we do have $\langle\psi|\hat{p}^{\circ n}|\psi\rangle=\langle p^n\rangle$. One can go even further using the power series expansion of analytic functions that $f(p)=f_0+f_1 p+\frac{1}{2} f_2 p^2+\cdots$ to show that the correspondence between operator and expectation value even holds for functions $\langle\psi|f(\hat{p})|\psi\rangle=\langle f(p)\rangle$. And of cause $\hat{p}$ is not limited to momentum operator, it can be replaced by any Hermitian operator. The statement is that for any physical observable, represented by a Hermitian operator $\hat{A}$ in quantum mechanics, the operator $f(\hat{A})$ corresponds to its classical observable $\langle f(A)\rangle$ for any analytic function $f$.
A: If I understand correctly the question (not sure I do...),
The question is basically a linear algebra one.
Consider an operator $\hat{A}$, that has a eigenvalue $a$,
the eigenfunctions/eigenvectors of $\hat{A}$ are denoted by $|a\rangle$ such that:
$$
\hat{A}|a\rangle=a|a\rangle
$$
Now consider a composite of $\hat{A}\circ\hat{A}$, that operates on $|a\rangle$:
$$
\hat{A}\circ\hat{A}|a\rangle=a\hat{A}|a\rangle=a^2 |a\rangle
$$
So it is a convenient notation to write $\hat{A}^2\equiv\hat{A}\circ\hat{A}$ at is also used in mathematics notation.
Another fun fact is that an operator will always commute with itself thusly:
$$
\left[\hat{A},\hat{A}\right]=0
$$
So there is no fear of ambiguity in using a term like $\hat{A}^2$ or $\hat{A}^n$ for that matter.
As for the physical correspondence - the operators themselves are labeled by the expectation value they yield, thus in momentum space, $\hat{P}$ operating on a momentum ket, yields the eigenvalue of the momentum. "sandwiched" together like so:
$$
\langle p|\hat{P}|p\rangle =p
$$
this yields the correct eigenvalue that corresponds to the momentum of that state.
It is also a fun fact, that:
$$
\langle p|\hat{X}|p\rangle \neq x
$$
So it is a convenient labeling convention essentially.
edit:
On convention: "for fundamental properties we will borrow only names from classical physics" - J.Schwinger
One can see momentum as the generator of translations, so applying the operator $\hat{P}$ once translates the function once (infinitesimally), applying it then, again, to the translated function $\hat{P}\psi$ translates it again.
I turn you to Sakurai's Modern Quantum Mechanics chapter 1.6.
There is a whole discussion there on momentum operator.
