Can a molecular formula be used to predict the molecular shape of a small molecule? Please explain how.

It depends upon how it is written. It often helps with organics, and how familiar one is with the various groupings like, COOH, CH3, OH etc. It usually does not help with inoganics. H2O is really HOH (bent) structurally, for example. CO2 is OCO (linear)