The following doesn't exactly answer your question, and it misses a lot of details, but it might help you understand a little better what is going on with observables in quantum mechanics.
In quantum mechanics, observables are self-adjoint operators $T:\mathcal H\to \mathcal H$ on a Hilbert space $\mathcal H$ of states. The eigenvalues of the observable are the possible outcomes of a measurement. The spectral theorem tells us, that the eigenvectors of an observable $T$ are pairwise orthogonal and span $\mathcal H$, thus every state is a linear combination of the eigenstates of $T$. Let $\psi_k$ be the eigenstate with eigenvalue $k$, i.e. $T\psi_k = k \psi_k$, then any state $\psi\in\mathcal H$ can be expressed as a linear combination
$$ \psi = \sum_i c_i \psi_i + \int\mathrm c(k)\,\psi_k\,\mathrm dk$$
where the sum goes over the discrete part of the spectrum of $T$ and the integral over the continuous part of the spectrum. The discrete values $|c_i|^2$ are the actual probabilities to measure $\psi$ in the state $\psi_i$, while the function $|c(k)|^2$ is a probability density. Thus, the expected value when measuring the observable $T$ on a system in state $\psi$ is
\begin{align}
\langle T\rangle &= \sum_i |c_i|^2 i + \int |c(k)|^2\, k\,\mathrm dk.
\end{align}
Now let's return to the examples of position and momentum and 1-dimensional space. Here $\mathcal H$ is the space of square-integrable wave functions $\psi:\mathbb R\to\mathbb C$, i.e. $\mathcal H = L^2(\mathbb R)$. The position operator $Q:\mathcal H\to\mathcal H$ is given by $(Q\psi)(x)= x\psi(x)$, it is just multiplication by $x$. In order to apply our probabilistic theory, we have to find all eigenvalues and eigenvectors of $Q$:
$$Q \,\psi_q = q \,\psi_q,$$
which translates to
$$x \,\psi_q(x) = q \,\psi_q(x).$$
This looks weird, when you haven't seen anything like it before. If $\psi_q$ would be nonzero for two values of $x$, say $x_0, x_1$, it can't be a solution, since $\psi_q(x_0)\neq 0$ gives $q=x_0$ and $\psi_q(x_1)\neq 0$ gives $q=x_1$. Thus it will be nonzero only for a single $x\in\mathbb R$. Since it also has two be square-integrable with nonzero $L^2$-norm, there is no such function satisfying our constraints. The only way out is to allow distributions. Indeed, $\psi_q(x) = \delta(x-q)$ does the job:
$$ x\,\delta(x-q) = q\,\delta(x-q).$$
Now given any wave function $\psi\in\mathcal H$, we can decompose it as
$$ \psi(x) = \int \psi(q) \delta(x-q)\,\mathrm dq,$$
which says that $|\psi(q)|^2$ is the probability density of the position $q$ — the general theory gives exactly what we expected! The expected value
$$ \langle Q\rangle = \int |\psi(x)|^2 x \,\mathrm dx = \int \psi^*(x) x\psi(x) \,\mathrm dx$$
also matches what we already knew.
For the momentum operator $P=-i\hbar \frac{\mathrm d}{\mathrm dx}$, the eigenfunctions turn out to be $\psi_p(x)=e^{i\frac{p}{\hbar} x}$ and the decomposition of a state $\psi$ into those is obtained by the Fourier transform. Calculating $\langle P\rangle$ from the general equation I gave above, you will find what you already knew as well. In fact, we find
$$\langle T \rangle = \int \psi^*(x) (T\psi)(x)\,\mathrm dx.$$