$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
\newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
\newcommand{\dd}{{\rm d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
\newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
\newcommand{\half}{{1 \over 2}}
\newcommand{\ic}{{\rm i}}
\newcommand{\imp}{\Longrightarrow}
\newcommand{\Li}[1]{\,{\rm Li}_{#1}}
\newcommand{\pars}[1]{\left(\, #1 \,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
\newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
You are missing the Green's function continuity at $x = x'$. See below.
Write your solution as
$$
{\rm f}\pars{x} =
a + \pars{b - a}x + \int_{0}^{1}{\rm G}\pars{x,x'}{\rm g}\pars{x'}\,\dd x'
$$
such that your Green's function satisfies homogeneous boundary conditions:
$$
{\rm G}\pars{0,x'} = {\rm G}\pars{1,x'} = 0\,\qquad\forall\ x' \in \pars{0,1}
$$
Then,
$$
{\rm G}\pars{x,x'} =
\left\lbrace\begin{array}{lcrcl}
Ax & \mbox{if} & x & < & x'
\\
B\pars{1 - x} & \mbox{if} & x & > & x'
\end{array}\right.
$$
Also,
$$
\left.\partiald{{\rm G}\pars{x,x'}}{x}\right\vert_{x\ =\ x'^{-}}^{x\ =\ x'^{+}} = 1
\qquad\mbox{and}\qquad{\rm G}\pars{x,x'^{-}} = {\rm G}\pars{x,x'^{+}}
$$
yield
$$
\left.\begin{array}{rcrcl}
A & + & B & = & - 1
\\
x'A & + & \pars{x' - 1}B & = & 0
\end{array}\right\rbrace
\qquad\imp\qquad
\left\lbrace\begin{array}{rcl}
A & = & \phantom{-}x' - 1
\\
B & = & -x'
\end{array}\right.
$$
$$
\begin{array}{|c|}\hline\mbox{}\\
{\rm G}\pars{x,x'} =
\left\lbrace\begin{array}{lcrcl}
\pars{x' - 1}x & \mbox{if} & x & < & x'
\\
\pars{x - 1}x' & \mbox{if} & x & > & x'
\end{array}\right.
\\ \mbox{}\\ \hline
\end{array}
$$