$\frac{\frac{1}{2}\times\frac{k}{k+7}}{\frac{1}{2}\times\frac{k}{k+7}+\frac{1}{2}\times\frac{2}{5}} = \frac{\frac{1}{2}\times\frac{k}{k+7}}{\frac{1}{2}(\frac{k}{k+7}+\frac{2}{5})} = \frac{\frac{k}{k+7}}{\frac{k}{k+7}+\frac{2}{5}}$
So far so good. But notice $\frac 25 = \frac 25*\frac {k+7}{k+7}=\frac 2{5(k+7)}(k+7)$ so we can do one more step.
$=\frac{\frac{k}{k+7}}{\frac{k}{k+7}+\frac{2}{5(k+7)}(k+7)}=\frac {\frac 1{k+7}\times k}{\frac 1{k+7}\times (k + \frac 25(k+7))}$
which does it.
Although... advice: Factoring fractions out and canceling is fine, but multiplying top and bottoms to simplify is easier.
$\frac{\frac{1}{2}\times\frac{k}{k+7}}{\frac{1}{2}\times\frac{k}{k+7}+\frac{1}{2}\times\frac{2}{5}} = \frac{(\frac{1}{2}\times\frac{k}{k+7})\times 2}{(\frac{1}{2}\times\frac{k}{k+7}+\frac{1}{2}\times\frac{2}{5})\times 2}= \frac{\frac{k}{k+7}}{\frac{k}{k+7}+\frac{2}{5}}$
$= \frac{\frac{k}{k+7}\times(k+7)}{(\frac{k}{k+7}+\frac{2}{5})\times (k+7)}=\frac k{k + \frac 25(k+7)}$
====
Frankly, I'd take it one step further and
$\frac k{k + \frac 25(k+7)}= \frac {k\times 5}{(k + \frac 25(k+7))\times 5}= \frac {5k}{5k + 2k + 14} = \frac {5k}{7k + 14} = \frac {5k}{7(k+2)}$
but.... I guess you weren't asked to go that far. And you don't have to. It's just what I would do.