Do all fish lay eggs to produce offspring?

No. While most fish do lay eggs there are a number of species that give live birth to their fish fry (e.g. Molly)