Improved version
Now the work is simplified through a \DrawEpigraph command:

The code:
\documentclass[varwidth=30cm,border=3pt]{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{arrows.meta,intersections}
\DeclareMathOperator{\dom}{dom}
\pgfmathdeclarefunction{cubic}{1}{%
\pgfmathparse{-2*(#1+2)*(#1+2)*(#1-2)+40}%
}
\pgfmathdeclarefunction{cubicii}{1}{%
\pgfmathparse{-2*(#1-1)*(#1-1)*(#1-5)+20}%
}
\pgfmathdeclarefunction{bicuadratic}{1}{%
\pgfmathparse{(#1-1)*(#1-1)*(#1-1)*(#1-1)+10}%
}
\pgfmathdeclarefunction{cuadratic}{1}{%
\pgfmathparse{(-(2*#1)^2)+70}%
}
\pgfmathdeclarefunction{cuadraticii}{1}{%
\pgfmathparse{-4*(#1-7)*(#1-9)+38}%
}
\pgfplotsset{compat=1.12}
\makeatletter
\pgfplotsset{
mark max/.style={
point meta rel=per plot,
visualization depends on={x \as \xvalue},
scatter/@pre marker code/.code={%
\ifx\pgfplotspointmeta\pgfplots@metamax
\def\markopts{mark=none}%
\coordinate (maximum);
\fi
\def\markopts{mark=none}
\expandafter\scope\expandafter[\markopts]
},%
scatter/@post marker code/.code={%
\endscope
},
scatter
}
}
% Syntax
% \DrawEpigraph[<additional options>]{<min domain x>}{<max domain x>}{<shift on the left>}{<shift on the right>}
\newcommand\DrawEpigraph[6][draw=white,top color=gray!80!black!05,bottom color=gray!90!black!80]{
\coordinate (plot-left) at ([yshift=#4]axis cs:#2,\pgfplots@metamax);
\coordinate (plot-right) at ([yshift=#5]axis cs:#3,\pgfplots@metamax);
\path[name path=diagonal,draw=none] (plot-left) -- (plot-right);
\addplot[#1] fill between[of=#6 and diagonal];
}
\makeatother
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-3.5:2.5,
ymin=-1,
xmin=-4,
xmax=3,
clip=false,
]
% The curve
\addplot [mark max,black,name path=B,samples=100] plot {cubic(x)};
% The Epigraph
\DrawEpigraph{-3.5}{2.5}{15}{5}{B}
% Lines and labels
\node[pin={120:Epigraph}] at (axis cs:-1,{cubic(-3.5)+2}) {};
\draw[dashed]
(axis cs:-3.5,0) -- (axis cs:-3.5,{cubic(-3.5)});
\draw[dashed]
(axis cs:2.5,0) -- (axis cs:2.5,{cubic(2.5)});
\draw[|<->|]
(axis cs:-3.5,-5) -- node[fill=white] {$\dom(f)$} (axis cs:2.5,-5);
\end{axis}
\end{tikzpicture}\qquad
%
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-1.2:3.5,
ymin=-10,
xmin=-3,
xmax=5,
clip=false,
]
% The curve
\addplot [mark max,black,name path=B,samples=100] plot {bicuadratic(x)};
% The Epigraph
\DrawEpigraph{-1.2}{3.5}{7}{15}{B}
% Lines and labels
\node[pin={90:Epigraph}] at (axis cs:2,{bicuadratic(3.35)+10}) {};
\draw[dashed]
(axis cs:-1.2,0) -- (axis cs:-1.2,{bicuadratic(-1.2)});
\draw[dashed]
(axis cs:3.5,0) -- (axis cs:3.5,{bicuadratic(3.5)});
\draw[|<->|]
(axis cs:-1.2,-5) -- node[fill=white] {$\dom(f)$} (axis cs:3.5,-5);
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-3:3,
ymin=-10,
xmin=-3.5,
xmax=3.5,
clip=false,
]
% The curve
\addplot [mark max,black,name path=L,samples=100] plot {cuadratic(x)};
% The Epigraph
\DrawEpigraph{-3}{3}{9}{15}{L}
% Lines and labels
\node[pin={90:Epigraph}] at (axis cs:2,{cuadratic(0)+1}) {};
\draw[dashed]
(axis cs:-3,0) -- (axis cs:-3,{cuadratic(-3)});
\draw[dashed]
(axis cs:3,0) -- (axis cs:3,{cuadratic(3)});
\draw[|<->|]
(axis cs:-3,-8) -- node[fill=white] {$\dom(f)$} (axis cs:3,-8);
\end{axis}
\end{tikzpicture}\qquad
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-2.5:2,
ymin=-1,
xmin=-4,
xmax=3,
clip=false,
]
% The curve
\addplot [mark max,black,name path=B,samples=100] plot {cubic(x)};
% The Epigraph
\DrawEpigraph[top color=black!10,bottom color=black!70]{-2.5}{2}{5}{10}{B}
% Lines and labels
\node[pin={120:Epigraph}] at (axis cs:-1,{cubic(1)}) {};
\draw[dashed]
(axis cs:-2.5,0) -- (axis cs:-2.5,{cubic(-2.5)});
\draw[dashed]
(axis cs:2,0) -- (axis cs:2,{cubic(2)});
\draw[|<->|]
(axis cs:-2.5,-5) -- node[fill=white] {$\dom(f)$} (axis cs:2,-5);
\end{axis}
\end{tikzpicture}\par\bigskip
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
ymin=-1,
xmin=-0.5,
xmax=9.5,
width=14cm,
height=8cm,
clip=false,
]
% The curve
\addplot [mark max,black,name path=B,samples=100,domain=0.5:5] plot {cubicii(x)};
% The Epigraph
\DrawEpigraph{0.5}{5}{5}{20}{B}
\addplot [mark max,black,name path=C,samples=100,domain=6:9] plot {cuadraticii(x)};
\DrawEpigraph{6}{9}{5}{10}{C}
% Lines and labels
\node[]
at (axis cs:5.5,47)
(epi) {Epigraph};
\draw
(epi.300) -- ++(-40:1cm)
(epi.240) -- ++(-150:1cm);
% Graph on the left
\draw[dashed]
(axis cs:0.5,0) -- (axis cs:0.5,{cubicii(0.5)});
\draw[dashed]
(axis cs:5,0) -- (axis cs:5,{cubicii(5)});
\draw[|<->|]
(axis cs:0.5,-5) -- (axis cs:5,-5);
% Graph on the right
\draw[dashed]
(axis cs:6,0) -- (axis cs:6,{cuadraticii(6)});
\draw[dashed]
(axis cs:9,0) -- (axis cs:9,{cuadraticii(9)});
\draw[|<->|]
(axis cs:6,-5) -- (axis cs:9,-5);
\end{axis}
\end{tikzpicture}
\end{document}
Explanation
You use the mark max option for the plot for whcih you wnat to draw the epigraph:
\addplot [mark max,black,name path=B,samples=100] plot {cubic(x)};
The \DrawEpigraph command draws the desired epigraph in a manner that it will always be no lower than the maximum of the plot and with the desired inclination. For example:
\DrawEpigraph{-3.5}{2.5}{15}{5}{B}
will draw the epigraph for the plot (previously named) B from -3.5 to 2.5 with 15 y-shift to the left and 5 y-shift to the right. Using the optional argument, additional options can be passed to the \addplot internally used:
\DrawEpigraph[top color=red!10,bottom color=red!70!black]{3.5}{2.5}{15}{5}{B}
The mark max option is a modification of Jake's code in his answer to How can I automatically mark local extrema with pgfplots and scatter?.
First version
You can do something like this:

The code:
\documentclass[border=3pt]{standalone}
\usepackage{amsmath}
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{arrows.meta}
\tikzset{>=latex}
\DeclareMathOperator{\dom}{dom}
\pgfmathdeclarefunction{cubic}{1}{%
\pgfmathparse{-2*(#1+2)*(#1+2)*(#1-2)+40}%
}
\pgfmathdeclarefunction{bicuadratic}{1}{%
\pgfmathparse{(#1-1)*(#1-1)*(#1-1)*(#1-1)+10}%
}
\pgfmathdeclarefunction{cuadratic}{1}{%
\pgfmathparse{(-(2*#1)^2)+70}%
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-3.5:2.5,
ymin=-1,
xmin=-4,
xmax=3,
clip=false,
]
%% The curve
\addplot [black,name path=B,samples=100] plot {cubic(x)};
%% The line
\addplot [no marks,draw=white,name path=C] coordinates
{(-3.5,{cubic(-3.5)+15}) (2.5,{cubic(-3.5)+5})};
\makeatother
%% filling
\addplot[draw=white,top color=gray!80!black!05,bottom color=gray!90!black!80]
fill between[of=B and C,
soft clip={domain=-3.5:2.5}
];
\node[pin={120:Epigraph}] at (axis cs:-1,{cubic(-3.5)+7}) {};
\draw[dashed]
(axis cs:-3.5,0) -- (axis cs:-3.5,{cubic(-3.5)});
\draw[dashed]
(axis cs:2.5,0) -- (axis cs:2.5,{cubic(2.5)});
\draw[|<->|]
(axis cs:-3.5,-10) -- node[fill=white] {$\dom(f)$} (axis cs:2.5,-10);
\end{axis}
\end{tikzpicture}\qquad
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-1.2:3.5,
ymin=-10,
xmin=-3,
xmax=5,
clip=false,
]
%% The curve
\addplot [no marks,black,name path=B,samples=100] plot {bicuadratic(x)};
%% The line
\addplot [no marks,draw=white,name path=C] coordinates
{(-1.2,{bicuadratic(-1.2)+20}) (3.5,{bicuadratic(3.5)+20})};
%% filling
\addplot[draw=white,top color=gray!80!black!05,bottom color=gray!90!black!80]
fill between[of=B and C,soft clip={domain=-1.5:3.5}];
\node[pin={90:Epigraph}] at (axis cs:2,{bicuadratic(3.35)+17}) {};
\draw[dashed]
(axis cs:-1.2,0) -- (axis cs:-1.2,{bicuadratic(-1.2)});
\draw[dashed]
(axis cs:3.5,0) -- (axis cs:3.5,{bicuadratic(3.5)});
\draw[|<->|]
(axis cs:-1.2,-5) -- node[fill=white] {$\dom(f)$} (axis cs:3.5,-5);
\end{axis}
\end{tikzpicture}\qquad
\begin{tikzpicture}
\begin{axis}[
axis lines=middle,
xlabel={$x$},
ylabel={$f(x)$},
xtick={\empty},
ytick={\empty},
domain=-3:3,
ymin=-10,
xmin=-3.5,
xmax=3.5,
clip=false,
]
%% The curve
\addplot [no marks,black,name path=B,samples=100] plot {cuadratic(x)};
%% The line
\addplot [no marks,draw=white,name path=C] coordinates
{(-3,{cuadratic(0)+3}) (3,{cuadratic(0)+7})};
%% filling
\addplot[draw=white,top color=gray!80!black!05,bottom color=gray!90!black!80]
fill between[of=B and C,soft clip={domain=-3:3}];
\node[pin={90:Epigraph}] at (axis cs:2,{cuadratic(0)+1}) {};
\draw[dashed]
(axis cs:-3,0) -- (axis cs:-3,{cuadratic(-3)});
\draw[dashed]
(axis cs:3,0) -- (axis cs:3,{cuadratic(3)});
\draw[|<->|]
(axis cs:-3,-8) -- node[fill=white] {$\dom(f)$} (axis cs:3,-8);
\end{axis}
\end{tikzpicture}
\end{document}