Look up the atomic weights of C, H, and O. If the molecule has n C atoms, m H atoms, and p Oa atoms, then the molecular weight would be nC+ mH+ pO where "C", "H", and "O" are now the atomic weights of those atoms.
The unknown acid has a mass of 60.05 grams. You need to know the atomic weights of C (12.01) H (1.01) and O (16.00). You know that the molecular formula is 40% Carbon (the percent composition) so multiply 60.05 with .400 (the mass of the acid and the decimal representation of the composition of carbon) and you get 24.02. What this tells you is 24.02 grams of the 60.05 grams are Carbon. In order to find the number of carbon atoms in the acid you have to divide this number with the atomic mass of carbon, and you get 2. So the molecular formula will be C2HxOy, you still need to find x and y. You can find them with a similar method.