Consider the harmonic oscillator hamiltonian $$\hat{H} = \frac{1}{2}(\hat{x}^2+\hat{p}^2)$$ where as usual $[\hat{x},\hat{p}] = i$ (with $\hbar=1$).
We could use the ladder ops $\hat{a}=\frac{1}{\sqrt{2}}(\hat{x}+i\hat{p})$ and $\hat{a}^{\dagger}=\frac{1}{\sqrt{2}}(\hat{x}-i\hat{p})$ to rewrite the Hamiltonian as $\hat{H} = \frac{1}{2}(\hat{a}^{\dagger}\hat{a}+1)$. Going through the usual argument, using the positivity of the norm and the commutation relations of $\hat{H}$ and $\hat{a}$, we conclude the existence of a vacuum state $\left| 0 \right>$ such that $\hat{a}\left|0\right> =0$. We choose $\left< 0 | 0\right> = 1$, and construct the Fock basis as $\left| n\right> = \frac{(\hat{a}^{\dagger})^n}{\sqrt{n!}}\left|0\right>$ such that $\left< n | m\right>=\delta_{nm}$. It is important to note that throughout this construction, we only assumed the positivity of the norm, and we did not specify concretely what the inner product on the Hilbert space is, in fact we derived the inner product expressed in terms of the Fock basis from other considerations.
Alternatively, if we had started in the Schodinger basis, namely, $\hat{x}\left|x\right> = x\left| x\right>$, $\left< x| x'\right> = \delta(x-x')$, and $\left<x\right|\hat{p}\left|x'\right> = -i\delta(x-x')\frac{\partial}{\partial x}$, we could solve for the eigenstates as expressed in the position basis. Note that in this case, the inner product is specified from the beginning by $\left< x| x'\right> = \delta(x-x')$, and not derived as in the Fock representation.
My question is, what guarantees that the Fock and Schrödinger Representations above are the same, i.e. they yield the same inner product? How do I know that in the Fock representation $\left< x| x'\right> = \delta(x-x')$ as well?