b = hours babysitting
m = hours giving music lessons
so... whatever "b" and "m" are, their sum for that week was 18
thus
b + m = 18
now, money wise, she makes $5 for "b" and that is, she made 5*b or 5b that week
for "m", she makes $12, so for that week she made 12*m or 12m
whatever "b" and "m" are
thus
5b + 12m = 139
now [tex]\bf \begin{cases}
b+m=18\to \boxed{m}=18-b\\\\
5b+12m=139\\
----------\\
5b+12\left( \boxed{18-b}\right)=139
\end{cases} [/tex]
solve for "b", to see how many hours she spent babysitting