How is the wavefunction collapse related to the application of that operator on a state? I am following Griffith's Introduction to Quantum Mechanics, and after proving that
$$\sigma _A ^2 \sigma _B ^2 \geq \left( \frac{1}{2i} \langle [A,B]\rangle \right)$$
he says

You can certainly measure the position of the particle, but the act of measurement collapses the wave function to a narrow spike, which necessarily carries a broad range of wavelengths in its Fourier decomposition. If you now measure the momentum, the state will collapse to a long sinusoidal wave, with now a well-defined wavelength - but the particle no longer has the position you got in the first measurement.

This is my understanding of the above paragraph:
I have a state of interest $\Psi (x,t)$. I make a measurement of, say, position. Just to make things concrete, lets take the simple case of a particle in an infinite square well,
$$\Psi (x,t) = \sum _{n=1} ^{\infty} c_n \sqrt{\frac{2}{a}} \sin \left(\frac{n\pi}{a}x\right) e^{-i(n^2\pi^2\hbar/2ma^2)t}$$Mathematically, this measurement is
$$\hat{x}\Psi = x\Psi$$
where $\hat{x}$ is the position operator, and $x$ is the eigenvalue.
How has the above act, of tacking on an $x$ to the function $\Psi$ collapsed the wavefunction to a narrow spike?
Now, if I find the momentum of my state,
$$\hat{p}\hat{x}\Psi = -i\hbar \frac{\partial}{\partial x}(x\Psi)$$
how has this collapsed to a sinusoidal wave?
I would appreciate any advice you have regarding this issue. I have a suspicion that my understanding of what taking a measurement is mistaken...
 A: It’s just a fundamental postulate of quantum mechanics that after you make a measurement, the system’s quantum state changes to an eigenstate of the observable you measured that corresponds to the measured eigenvalue. There’s no derivation of that fact (although certain interpretations of QM do give somewhat heuristic arguments for why this occurs).
A: I think your confusion is arising because you may have read (possibly in Zetilli's Quantum Mechanics) that the act of measurement of observable $\hat  A$ is mathematically represented by $\hat  A \Psi$.
Do not take this literally. You can't think this to mean that applying an operator on the wave function will give you an eigenstate of that operator (i.e. the wavefunction collapse) which will be a result of that measurement. If that were true, you would always get the same answer mathematically , but would your measurement give you the same result everytime?
That would happen only in the case where the wavefunction is already an eigenstate of that operator, in which the above statement is true but trivial.
A: If you go through the postulates of Quantum Mechanics, you will find

The result of measuring a physical quantity $\mathcal{A}$ must be one of the eigenvalues of the corresponding observable $\mathcal{A}$.

Now suppose you have taken the position measurement and found the particle to be at $x_0$, How would represent such a wavefunction?
Let's say
$$\langle x|\Psi\rangle =\psi(x)=\delta (x-x_0)$$
let's varify that's it's eigenfunction of $X$ with eigenvalue $x_0$.
$$X|\Psi\rangle =X\int |x\rangle \langle x|\Psi\rangle dx=\int x|x\rangle \delta (x-x_0)dx=x_0|x_0\rangle$$
(Note the abuse of notation)
How would momentum space wave function look like?
$$\tilde{\psi}(p)\sim \int e^{-ipx/\hbar}\psi(x)dx=\int e^{-ipx/\hbar}\delta(x-x_0)dx=e^{-ipx_0/\hbar}$$
which corresponds to plane wave (A uniform probability distribution).

Similarly, if you take momentum measurement you will get $\tilde{\psi}(p)=\delta(p-p_0)$ and so $\psi(x)\sim e^{ip_0x/\hbar}$.
