A pack of 7 pens cost $6 . A pack of 9 files cost $12. Fred wants to buy an equal number of pens and files. What is the least amount that he must pay?

You haven't said how many he must buy, only that they must be the same for each.

The least money spent would be if he bought zero of each.

Since Fred wants an equal number of pens and files and must buy them in packaged groups of 7 (pens) and 9 (files), his next option would be to buy the least common multiple of 7 and 9 individual items, which is 63.

63 pens (in 9 packs) cost $54
63 files (in 7 packs) cost $84.

Tho total spent is $138 in this case.