Suppose we have a second order PDE: $$(-\partial^2+m^2)f(x)=0.\tag{1}$$ The solution to this equation is: $$f(x)=C_1e^{-m x}+C_2e^{mx}\tag{2}.$$ I want to obtain this solution by Fourier transformation. Taking $$f(x)=\int \frac{dk}{2\pi}e^{ikx}f(k),$$ then we have $$(k^2+m^2)f(k)=0.\tag{3}$$ Now the problem is that, to recover the solution Eq.(2), it seems that we need to ask $$f(k)=C_1*2\pi\delta(k-im)+C_2*2\pi\delta(k+im) =\tilde{C}_1\delta(k-im)+\tilde{C}_2\delta(k+im).\tag{4}$$
While I am clear that Eq.(3) is an "on-shell" condition equation, I do not see clearly why we must enforce a delta function on $f(k)$.