\documentclass{standalone}
\usepackage{tikz}


\begin{document}
\begin{tikzpicture}
\draw[thin,->] (-1,0)--(9.2,0) node[below] {$x$};

\draw[very thick, blue] plot[domain=0:2] function {x**2-1.5};
\draw[very thick, blue] plot[domain=4:6] function {(x-4)**2-1.5};
\draw[very thick, blue] plot[domain=8:9] function {(x-8)**2-1.5};
\draw[very thick, blue] plot[domain=-1:0] function {-x**2+1.5};
\draw[very thick, blue] plot[domain=2:4] function {-(x-4)**2+1.5};
\draw[very thick, blue] plot[domain=6:8] function {-(x-8)**2+1.5};

\draw[dashed,red] (0,-1.5)--(0,1.5);
\draw[dashed,red] (4,-1.5)--(4,1.5);
\draw[dashed,red] (8,-1.5)--(8,1.5);
\draw[dashed,red] (2,-2.5)--(2,2.5);
\draw[dashed,red] (6,-2.5)--(6,2.5);




\draw[thin,->] (-1,-7)--(9.2,-7) node[below] {$x$};

\draw[very thick, blue] plot[domain=0:2] function {x**2-8.5};
\draw[very thick, blue] plot[domain=4:6] function {(x-4)**2-8.5};
\draw[very thick, blue] plot[domain=8:9] function {(x-8)**2-8.5};

\draw[very thick, blue] plot[domain=-1:0] function {x**2-8.5};
\draw[very thick, blue] plot[domain=2:4] function {(x-4)**2-8.5};
\draw[very thick, blue] plot[domain=6:8] function {(x-8)**2-8.5};

\draw[dashed,green] (0,-8.5)--(0,-7);
\draw[dashed,green] (4,-8.5)--(4,-7);
\draw[dashed,green] (8,-8.5)--(8,-7);
\draw[dashed,green] (2,-4.5)--(2,-7);
\draw[dashed,green] (6,-4.5)--(6,-7);




\draw[thin,->] (-1,-14)--(9.2,-14) node[below] {$x$};

\draw[very thick, blue] plot[domain=0:2] function {x**2-15.5};
\draw[very thick, blue] plot[domain=2:6] function {-(x-4)**2-12.5};
\draw[very thick, blue] plot[domain=6:9] function {(x-8)**2-15.5};

\draw[very thick, blue] plot[domain=-1:0] function {x**2-15.5};


\draw[dashed,green] (0,-15.5)--(0,-14);
\draw[dashed,green] (4,-12.5)--(4,-14);
\draw[dashed,green] (8,-15.5)--(8,-14);

\draw[dashed,red] (2,-16.5)--(2,-11.5);
\draw[dashed,red] (6,-16.5)--(6,-11.5);



\end{tikzpicture}
\end{document}