We define the Fourier transform of $f \in L^1(\mathbb{R}^n)$ with the usual formula $\int e^{-i k \cdot x} f(x) dx$. This does not work for the functions in $L^2(\mathbb{R}^n)$. The defining integral may not converge. However, we can extend Fourier transform to $L^2(\mathbb{R}^n)$ by its continuity. First show that Fourier transform on Schwartz functions $S \subset L^2(\mathbb{R}^2)$ is an isometry with respect to the $L^2$ norm. Then, by the continuity (isometries are continuous) of the Fourier transform on $S$ and the densinty of $S$ in $L^2(\mathbb{R}^n)$, we can extend Fourier transform to the whole $L^2(\mathbb{R}^n)$ as an isometry. $L^2(\mathbb{R^n})$ is complete so the extension is unique and surjective. Therefore it is unitary, not merely an isometry. Thus the Fourier transform of an $L^2(\mathbb{R^n})$ function is also an $L^2(\mathbb{R^n})$ function and it preserves the inner product.
The above is a rather long quote from the material in a class I attend. I don't have strong background on analysis but am struggling to understand the above argument. I think I can understand most part except the uniqueness and surjectivity. Why the completeness ensures the uniqueness and surjectivity?
I have read some textbooks on the same subject and found that the bijectivity is usually proved by the extension of the inversion formula on $S$ to $L^2$, which I can understand. For the uniqueness, I couldn't find any argument in my textbooks. Does the completeness of $L^2$ really ensure the uniqueness and surjectivity?
This is actually a standard functional analytic procedure. Suppose you have a Banach space $X$ and a dense subspace $D$. You are given a linear operator $T\colon D\to Y$, where $Y$ is some other Banach space. If this operator satisfies $$\tag{1} \|Tx\|\le C\|x\|, \qquad \forall x\in D, $$ then, for every Cauchy sequence $x_n\in D$, $Tx_n$ is also Cauchy in $Y$. To see this, note that $$\tag{2}\|Tx_n-Tx_m\|\le C\|x_n-x_m\|.$$ In particular, $Tx_n$ is convergent, because $Y$ is complete. Moreover, if $x_n$ and $x_n'$ are Cauchy sequences in $D$ that converge to the same limit, then $Tx_n$ and $Tx_n'$ also converge to the same limit, again because of (2).
This means that it makes sense to define $$Tx:=\lim_{n\to \infty} Tx_n, $$ for all $x\in X$, where $x_n\in D$ is any sequence that converges to $x$, because the result is independent of the choice of such a sequence. It remains to show that this defines a linear operator and that this operator satisfies (1) for all $x\in X$.
I now see that you ask something more, concerning surjectivity. This is again the same kind of reasoning, see Rudin, Real and complex analysis 3rd ed., Lemma 4.16.