Sorry you've learned the hard way that used cars are a crapshoot.
My first piece of advice would be to take the car to a reputable Ford dealer
and ask them to run the VIN number, and make sure all of the recall issues
have been dealt with. That shouldn't cost you anything.
The next task is to get the check engine light addressed. The car needs to
be hooked up to a diagnostic computer so the trouble codes can be
downloaded. Depending on the problem, this might or might not be
disastrously expensive to fix.
Lastly, where did you buy the car? If it was from some sort of dealer, you
may have some recourse, depending on what state you live in. If it was a
private party sale, you're pretty much out of luck.
'05 Focus ZXW Wagon
Click to see the full signature.