Just for typing exercise with PSTricks so I leave the code as is without optimization.
One
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-eucl}
\def\f{x -.5 sub x 2.5 sub mul 2 div }
\def\g{\f neg }
\begin{document}
\begin{pspicture}[dimen=m](-2,-2)(4.5,4.5)
\psaxes[ticks=none,labels=none]{->}(0,0)(-2,-2)(4,4)[$x$,0][$y$,90]
\pscustom[fillstyle=vlines,linestyle=none,hatchcolor=lightgray]{\psplot{-1}{3}{\f 2 add}\psplot{3}{-1}{\g 1 sub}}
\psplot{-1}{3}{\f 2 add}\psplot{-1}{3}{\g 1 sub}
\psxTick(-1){a}\psxTick(3){b}
\rput(1,.5){$A$}
\uput[45](!3 /x ED x \f 2 add){$f$}\uput[-45](!3 /x ED x \g 1 sub){$g$}
\end{pspicture}
\end{document}

Two
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-eucl}
\def\f{x -.5 sub x 2.5 sub mul 2 div }
\def\g{\f neg }
\begin{document}
\begin{pspicture}[dimen=m,saveNodeCoors,hatchsep=2pt](-2,-2)(4.5,4.5)
\pscustom[fillstyle=vlines,linestyle=none,hatchcolor=lightgray]{\psplot{-1}{3}{\f 3 add}\psplot{3}{-1}{\g .5 sub}}
% additional procedures:
\bgroup
\psset{PointName=none,PointSymbol=none}
\pstInterFF{\g .5 sub}{0}{0}{A}
\pstInterFF{\g .5 sub}{0}{2}{B}
\egroup
\pscustom[fillstyle=vlines,linestyle=none,hatchcolor=red]{\psplot{N-A.x}{N-B.x}{\g .5 sub}\psplot{N-B.x}{N-A.x}{0}}
\psaxes[ticks=none,labels=none]{->}(0,0)(-2,-2)(4,4)[$x$,0][$y$,90]
\psplot{-1}{3}{\f 3 add}\psplot{-1}{3}{\g .5 sub}
\psxTick(-1){a}\psxTick(3){b}
\rput(1,1.25){$A$}
\uput[45](!3 /x ED x \f 3 add){$f$}\uput[-45](!3 /x ED x \g .5 sub){$g$}
\end{pspicture}
\end{document}

Three
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-eucl}
\def\f{x -.5 sub x 2.5 sub mul 2 div }
\def\g{\f neg }
\begin{document}
\begin{pspicture}[dimen=m,saveNodeCoors,hatchsep=2pt](-2,-2)(4.5,4.5)
% additional procedures:
\bgroup
\psset{PointName=none,PointSymbol=none}
\pstInterFF{\g}{\f 1.2 add}{0}{A}
\pstInterFF{\g}{\f 1.2 add}{2}{B}
\egroup
\pscustom[fillstyle=vlines,linestyle=none,hatchcolor=lightgray]{\psplot{N-A.x}{N-B.x}{\f 1.2 add}\psplot{N-B.x}{N-A.x}{\g}}
\psaxes[ticks=none,labels=none]{->}(0,0)(-2,-2)(4,4)[$x$,0][$y$,90]
\psplot{-1}{3}{\f 1.2 add}\psplot{-1}{3}{\g}
\psxTick(-1){a}\psxTick(3){b}
\rput(!N-A.x N-B.x add 2 div .6){$A$}
\uput[45](!3 /x ED x \f 1.2 add){$f$}\uput[-45](!3 /x ED x \g){$g$}
\end{pspicture}
\end{document}

Latest update
If you want to use infix notation instead of postfix but at the same time you don't want to use algebraic option for unknown reason, consider the following. I just used the first case above as an example. The second and third cases are left for your exercises.
\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-eucl}
\def\f{((x-.5)*(x-2.5)/5)}
\def\g{(-\f)}
\pstVerb{/I2P {exec AlgParser cvx exec} def}
\begin{document}
\begin{pspicture}[dimen=m](-2,-2)(4.5,4.5)
\psaxes[ticks=none,labels=none]{->}(0,0)(-2,-2)(4,4)[$x$,0][$y$,90]
\pscustom[fillstyle=vlines,linestyle=none,hatchcolor=gray]{\psplot{-1}{3}{{(\f+2)} I2P}\psplot{3}{-1}{{(\g-1)} I2P}}
\psplot{-1}{3}{{(\f+2)} I2P}\psplot{3}{-1}{{(\g-1)} I2P}
\psxTick(-1){a}\psxTick(3){b}
\rput*(*1 .5){$A$}
\uput[45](*3 {\f+2}){$f$}\uput[-45](*3 {\g-1}){$g$}
\end{pspicture}
\end{document}
pgfplots, specifically itsfillbetweenlibrary (compare http://pgfplots.sourceforge.net/pgfplots.pdf section "Related libraries >> Fill between") – Christian Feuersänger Mar 10 '14 at 19:25