Assume Charles charges $7*3=$21 if he babysits for 2,5 hours (that is 2 and a half hours).
That is we are not considering Charles babysitting exactly 1, 2, 3 or 4 hours, but also in between times.
then we can write the following piecewise function to describe the situation:
f is a function from (0, 4] to {$7, $14, $21, $28}
[tex]f(x)=\begin{cases}
\$7 & if \enspace \enspace x\leq 1 \\
\$14 & if \enspace \enspace 1\ \textless \ x\leq 2 \\
\$21 & if \enspace\enspace 2\ \textless \ x\leq 3 \\
\$28 & if \enspace\enspace 3\ \textless \ x\leq 4 \
\end{cases}[/tex]