Under what conditions is a wavefunction $\psi(x)$ equal to the probability amplitudes $a(x)$? For context, consider a general expansion of a wavefunction into continuous eigenstates of position, $\phi(x_m,x)$, multiplied by continuous probability amplitudes, $a(x_m)$
$$\begin{align}\psi(x) &=\int_{x_m=-\infty}^{\infty}a(x_m)\phi(x_m,x)\, \mathrm{d}{x_m} \\& = \int_{x_m=-\infty}^{\infty}a(x_m)\delta(x-x_m)\, \mathrm{d}{x_m} \\&= a(x)\end{align}\tag{1}$$
I understand the equation $\psi(x)=a(x)$ since the Dirac delta sifts out the only value of $x$ for which the argument of the Dirac delta function is zero.
But $(1)$ is essentially a trivial situation since the position eigenstates are Dirac deltas and the 'sifting property' is then applied. The natural question to ask is what happens when the wavefunction (or its amplitudes) have a non trivial form?
I tried searching the internet to find an explanation for why the probability amplitudes are the same as the wavefunction itself, but I cannot get a straight answer. The following is a Quantum Mechanics past exam paper question (and solution), academic year: 2013-2014 from Imperial College London.
Question:

Consider the wavepacket 
  $$\psi_G(x)=A\exp\left(-\frac{(x-x_m)^2}{(2 \Delta x)^2}\right)\exp\left(\frac{i\, p_m x}{\hbar}\right)$$
  where $\Delta x$ is the RMS spread in position or uncertainty in position (standard deviation), $x_m$ is the mean postion of the particle, $p_m$ is the momentum of the wavepacket, $A$ is a normalization constant (that you need not calculate).
Eigenstates of the momentum operator with eigenvalue $p$ are given by
  $$\phi(p,x)=\frac{1}{\sqrt{2\pi \hbar}}\exp\left(\frac{i \, p x}{\hbar}\right)$$
  Find the wavefunction in the momentum representation.

Solution:

We need to find the wavefunction in the momentum representation:
  $$\begin{align}a_G(p)&=\int_{x=-\infty}^{\infty}\phi^*(p,x)\psi_G(x)\,\mathrm{d}x \\&= \int_{x=-\infty}^{\infty}\frac{A}{\sqrt{2 \pi \hbar}}\exp\left(\frac{-i \, p x}{\hbar}\right)\exp\left(\frac{-(x-x_m)^2}{(2 \Delta x)^2}\right)\exp\left(\frac{i\, p_m x}{\hbar}\right)\,\mathrm{d}x \\&=\int_{x=-\infty}^{\infty}\frac{A}{\sqrt{2 \pi \hbar}}\exp\left(\frac{-i \, p x}{\hbar}\right)\exp\left(\frac{-(x-x_m)^2}{(2 \Delta x)^2}\right)\exp\left(\frac{-i\,(p- p_m) x}{\hbar}\right)\,\mathrm{d}x \\&= \frac{A\sqrt{4\pi {\Delta x}^2}}{\sqrt{2\pi \hbar}}\exp\left(\frac{-(p-p_m)^2\Delta x^2}{\hbar^2}\right)\exp\left(\frac{-i\,(p- p_m) x_m}{\hbar}\right) \end{align}$$

That is the end of the solution. But in the solution $a_G(p)$ is written instead of $\psi(p)$, and since the objective of the question was to find the wavefunction, I can only deduce that the solution is suggesting that $a_G(p)=\psi(p)$. 
The reason I asked this question is because I fail to see where the relation $(1)$ is being utilized to show that $a_G(p)=\psi(p)$. Could anyone please explain to me the conditions that need to be satisfied for $a_G(p)=\psi(p)$?
While working with discrete eigenstates, it was never found that the wavefunctions are the same as the amplitudes. So does this mean that continuous eigenstates are needed for wavefunction=amplitudes? I would just like to know when I can write down wavefunction=amplitudes; just as the author wrote in the solution to the question I included.
I will try to rephrase this question in another way; Why doesn't the author use $\psi(p)=\int a_G(p)\phi(x_m,x)dx$ to find the wavefunction $\psi(p)$?
 A: 
I tried searching the internet to find an explanation for why the
  probability amplitudes are the same as the wavefunction itself, but I
  cannot get a straight answer.

While I'm sure the content of this answer is all over the internet, I'll still post this just in case it addresses your question.
The (position basis) wavefunction $\psi(x)$ just is the state vector (ket) $|\psi\rangle$ projected onto the coordinate basis $|x\rangle$ as so
$$\psi(x) = \langle x|\psi\rangle$$
where the $|x\rangle$ are the position eigenkets (state vectors with definite position)
$$X|x\rangle = x|x\rangle$$
Assuming as usual that $|\psi\rangle$ is normalized
$$\langle \psi|\psi\rangle = 1$$
and recalling that the bra-ket of $|\phi\rangle$ with $|\psi\rangle$ is the probability amplitude for the particle with state vector $|\psi\rangle$ to be found in the state $|\phi\rangle$
$$c_\phi = \langle\phi | \psi \rangle,\quad P_{\psi\rightarrow\phi} = |c_\phi|^2$$
it follows that $\psi(x)$ is the probability amplitude for the particle to be found in the position eigenket $|x\rangle$.
We use the fact that the position eigenkets satisfy
$$\int\mathrm{d}x\, |x\rangle\langle x| = 1$$
$$\langle x | x' \rangle = \delta(x - x')$$
to get this into a form like in your equation (1);
$$\psi(x) = \langle x| \psi\rangle = \int\mathrm{d}x'\,\langle x|x'\rangle\langle{x'}|\psi\rangle = \int\mathrm{d}x'\,\delta(x - x')\psi(x')$$


Is ⟨p|ψG⟩ the probability amplitudes (what I call aG(p) in my post) as
  well as the wavefunction in the momentum basis ψG(p)?

Stipulating that the $|p\rangle$ are the eigenkets of the momentum operator
$$P|p\rangle = p|p\rangle$$
then the probability amplitude for the particle with state vector $|\psi_G\rangle$ to be found in the momentum eigenket $|p\rangle$ is just
$$a_G(p) = \langle p|\psi_G\rangle = \psi_G(p)$$
Using the properties of the position eigenkets as above and also using the fact that
$$\langle p|x\rangle =  \frac{1}{\sqrt{2\pi}}e^{-ipx},\quad \left(\hbar = 1\right)$$
we can write
$$\psi_G(p) = \langle p|\psi_G\rangle = \int\mathrm{d}x'\,\langle p|x'\rangle\langle{x'}|\psi_G\rangle = \frac{1}{\sqrt{2\pi}}\int\mathrm{d}x'\,e^{-ipx'}\,\psi_G(x')$$
which shows that the momentum basis wavefunction (probability amplitude density) is the Fourier transform of the position basis wavefunction.
