Consider the differential equation $$\frac{d^2}{dx^2}=f(x)$$ with boundary conditions $y(0)=0$ and $y'(1)=0$. If we then let $f(x)=0$ we have a homogeneous differential equation. Then we know that the Green's function will be $$G(x,x')=Ax+B, x<x'$$ $$G(x,x')=Cx+D, x>x'.$$ Using the given boundary conditions, the boundary condition that $G(x,x')$ must be continuous at $x=x'$ and the boundary condition that the derivative with respect to $x$ of $G(x,x')$ must be discontinuous at $x=x'$ then it can be shown that $b=0$, $c=0$, $a=-1$ and $d=-x'$. Then Green's function is $$G(x,x')=-x, x<x'$$ $$G(x,x')=-x',x>x'.$$ Choose now $f(x)=x$ with the same boundary conditions so that our differential equation is inhomogeneous. Using $$y(x)=\int_0^1G(x,x')f(x')dx'$$ it can be shown that the solution to the inhomogeneous differential equation is $$y(x)=\frac{x^3}{6}-\frac{x}{2},$$ which is clearly the correct solution. The Green's function found from the homogeneous differential equation can be used to find the solution to any inhomogeneous equation of this same form, i.e. $f(x)\ne0$.
How can this work? I don't understand how this single Green's function found from a homogeneous differential equation can be used to solve any inhomogeneous differential equation of the same form as the original homogeneous one.