We note here that all of the ensuing analysis uses notation that is interpreted in the sense of Distributions or Generalized Functions.
With that note, let's begin by breaking the problem down into components, each of which is hopefully elementary.
STEP 1:
First, we know that the Fourier Transform of the Dirac Delta $\delta$ is
$$\begin{align}
\mathscr{F}\{\delta\}(k)&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\delta(x)e^{ikx}\,dx\\\\
&=\frac{1}{\sqrt{2\pi}}
\end{align}$$
ASIDE:
This implies that the Inverse Fourier Transform of the constant function $1$ is the Dirac Delta $\delta(x)$. We can rewrite this relationship as
$$\bbox[5px,border:2px solid #C0A000]{\int_{-\infty}^{\infty}e^{-ikx}\,dk=2\pi\,\delta(x)} \tag 1$$
where again the notation in $(1)$ is interpreted as a distribution.
STEP 2:
Second, recall that the Fourier Transform has the property such that the Fourier Transform of the $n$'th order derivative, $D^nf$, of a function $f$, is given by
$$\bbox[5px,border:2px solid #C0A000]{\mathscr{F}\{D^nf\}(k)=(ik)^n\mathscr{F}\{f\}(k)} \tag 2$$
STEP 3:
Now, define the ramp function $r(x)$ as
$$r(x)=
\begin{cases}
x&,x\ge 0\\\\
0&,x<0
\end{cases}$$
Note that the second derivative of the ramp function is $D^2r=\delta$. Using $(2)$ reveals that
$$\begin{align}
\mathscr{F}\{r\}(k)&=\frac{1}{(ik)^2}\mathscr{F}\{D^2r\}(k)\\\\
&=\frac{1}{\sqrt{2\pi}}\frac{1}{(ik)^2}
\end{align} \tag 3$$
STEP 4:
Taking the inverse Fourier Transform of $(3)$ and multiplying by $2\pi$ yields
$$\bbox[5px,border:2px solid #C0A000]{2\pi\,r(x)=\int_{-\infty}^{\infty}\frac{-1}{k^2}e^{-ikx}\,dk }\tag 4$$
STEP 5:
Finally, using $(4)$ we find that
$$\bbox[5px,border:2px solid #C0A000]{\frac{-1}{2\pi}\frac{q}{\epsilon_0}\int_{-\infty}^{\infty}\frac{1}{k^2}e^{ikx}\,dk=\frac{q}{\epsilon_0}r(x)}$$
We can use the preceding analysis to solve the more general one-dimensional Poisson Equation
$$f''(x)=\rho(x)$$
Taking Fourier Transforms yields
$$\hat f(k)=\frac{-1}{k^2}\hat \rho(k)$$
whereupon inversion reveals that
$$\begin{align}
f(x)&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\frac{-1}{k^2}\hat \rho(k)e^{-ikx}\,dk\\\\
&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\frac{-1}{k^2} \left(\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\rho(x')e^{ikx'}\,dx'\right)e^{-ikx}\,dk\\\\
&=\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\rho(x')\frac{1}{\sqrt{2\pi}}\int_{-\infty}^{\infty}\frac{-1}{k^2}e^{-ik(x-x')}\,dk\,dx'\\\\
&=\int_{-\infty}^{\infty}\rho(x')r(x-x')\,dx'\\\\
&=\int_{-\infty}^{x}(x-x')\,\rho(x')\,dx'\\\\
\end{align}$$
Thus, the general solution is
$$\bbox[5px,border:2px solid #C0A000]{f(x)=\int_{-\infty}^{x}(x-x')\,\rho(x')\,dx'}$$
Best Answer
Yes you can simply abandon the integrals because the Fourier transform is unique: if $\hat{f}=\hat{g}$ then $f=g$ (almost everywhere). To see this more clearly write your last equation as
$$\frac{1}{\sqrt{2\pi}}\int[\rho(k) + k^2f(k)]e^{ikx} = 0$$
Now the Fourier transform of $0$ is simply $0$ so by uniqueness $\rho(k) + k^2f(k) = 0$.
A slightly simpler way to solve your problem is to use the property $\hat{\left(\frac{d^nf}{dx^n}\right)} = (ik)^n\hat{f}$ which gives the desired result directly. This property is easily proven using integration by parts.