We note here that all of the ensuing analysis uses notation that is interpreted in the sense of Distributions or Generalized Functions.
We use the convention that the Fourier Transform of an integrable function $f\,$ (i.e., $f\in L^1$) is given by
$$\mathscr{F}\{f\}(k)=\frac1{\sqrt{2\pi}}\int_{-\infty}^\infty f(x) e^{ikx}\,dx$$
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}}
\end{align}$$
ASIDE:
This implies that the Inverse Fourier Transform of the constant $1$ (as a distribution) is $\sqrt{2\pi}$ times the Dirac Delta $\delta(x)$. We can rewrite this relationship as
$$\bbox[5px,border:2px solid #C0A000]{\mathscr{F^{-1}}\{1\}(x)=\sqrt{2\pi}\delta(x)} \tag 1$$
where again the notation in $(1)$ is interpreted as a tempered 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 distribution $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 (as a distribution) is $D^2r=\delta$. Using $(2)$ reveals that
$$\begin{align}
\mathscr{F}\{D^2r\}(k)&=(ik)^2\mathscr{F}\{r\}(k)\\\\
&=\frac1{\sqrt{2\pi}}
\end{align}$$
Multiplication of distributions is not generally defined (here $1/(ik)^2$ and $1$ are tempered distributions). But it can be shown, using for example the convolution theorem along with knowledge of the Fourier Transforms of $x$ and $H(x)$, that
$$\begin{align}
\bbox[5px,border:2px solid #C0A000]{\mathscr{F}\{r\}(k)=\frac1{\sqrt{2\pi}}\frac1{(ik)^2}-i\sqrt{\frac\pi2}\delta'(k)}\tag 3
\end{align}$$
where the term $\psi(k)=\frac1{(ik)^2}$ is the distribution defined such that for any $\phi\in C_C^\infty$
$$\langle \psi,\phi\rangle =\lim_{\delta\to 0^+}\int_{|k|\ge \delta}\frac{\phi(k)-\phi(0)}{(ik)^2}\,dk$$
STEP 4:
Taking the inverse Fourier Transform of $(3)$ yields
$$\bbox[5px,border:2px solid #C0A000]{r(x)=\frac1{\sqrt{2\pi}}\mathscr{F^{-1}}\left\{\frac1{(ik)^2}\right\}(x) +\frac{x}2}\tag 4\\\\$$
STEP 5:
Finally, using $(4)$ we find that
$$\bbox[5px,border:2px solid #C0A000]{\frac{1}{\sqrt{2\pi}}\frac{q}{\epsilon_0}\mathscr{F^{-1}}\left\{\frac1{(ik)^2}\right\}(x) =\frac{q}{\epsilon_0}\frac12|x|}$$
We can use the preceding analysis to solve the more general one-dimensional Poisson Equation
$$f''(x)=\rho(x)$$
Taking Fourier Transforms yields in distribution
$$\hat f(k)=\frac{-1}{k^2}\hat \rho(k)+A\delta(k)+B\delta'(k)$$
whereupon inversion and invoking the convolution theorem reveals that
$$\begin{align}
f(x)&=\frac1{\sqrt{2\pi}}(A+ixB)+\mathscr{F^{-1}}\left\{\psi \hat \rho\right\}\\\\
&=\frac1{\sqrt{2\pi}}(A+ixB)+\frac1{\sqrt{2\pi}}\mathscr{F^{-1}}\left\{ \hat \rho\right\}*\mathscr{F^{-1}}\left\{ \psi\right\}\\\\
&=\frac1{\sqrt{2\pi}}(A+ixB)+\frac12\int_{-\infty}^\infty |x-x'|\rho(x')\,dx'
\end{align}$$
where the constants $A$ and $B$ can be found from conditions on $f(0)$ and $f'(0)$. Of course, if $f$ is purely real, then $B$ must be purely imaginary.
Thus, the general solution is
$$\bbox[5px,border:2px solid #C0A000]{f(x)=\frac12\int_{-\infty}^\infty |x-x'|\,\rho(x')\,dx'+C_1+C_2x}$$
for real constants $C_1$ and $C_2$. For example, if the $\rho(x)=\delta(x)$, then $f(x)=\frac12|x|+C_1$ where we enforced the condition that $f$ is an even function