The equation $$\frac{d^2}{dx^2}\phi(x)=f(x)\tag{1}$$ has the general solution $$\phi(x)=\phi_0(x)+\int G(x,x')f(x')dx^\prime\tag{2}$$ where $$\frac{d^2}{dx^2}G(x,x^\prime)=\delta(x-x^\prime)\tag{3}$$ and $\phi_0$ is any solution of $\frac{d^2}{dx^2}\phi_0(x)=0$.
Usually, problem (1) is accompanied by some boundary conditions such as $f(0)=1$ and $f(1)=0$ but $G$ is not. However, the solution of (1) using (2), requires us to know the solution of (3). But the solution of (3), in turn, requires boundary conditions on $G$ which does not come with the problem. If the boundary condition on $G$ is not known, how is it possible to find a unique solution to $(1)$?
In one dimension there exist several possible Green functions for the whole domain $\mathbb R\,:$ $$\tag{1} G(x,x')=\max(x-x',0)\,,\quad\text{ or },\quad G(x,x')=\frac{|x-x'|}{2}\,. $$ These functions satisfy (3) and are therefore fundamental solutions.
The problem with them is however that they are unbounded and will not yield a solution of the Poisson equation $$ \frac{d^2}{dx^2}\phi(x)=f(x)\,,\quad x\in\mathbb R\,, $$ for every $f\,.$
Nonetheless, the following should work (since the Wikipedia article about the Poisson equation that explains how you treat other domains and boundary conditions is only in German let me transcribe it briefly):