If she spent $x on pens at $2.50 each, then she bought x/2.50 pens.
And similarly she bought (x - 14.50) / 0.50 pencils.
So x/2.50 + (x - 14.50) / 0.50 = 19
Rather than cross multiply, which only works for two equal fractions, multiply both sides by the least common denominator which is 2.50. That cancels both denominators, and you get
x + 5(x - 14.50) = 47.50
x + 5x - 72.50 = 47.50
6x = 47.50 + 72.50 = 120
so x = 120 ÷ 6 = 20