When the engine quits just after takeoff, the pilot has few options. One is to attempt to turn around and try to land at the airport. It's such a difficult maneuver that it's often referred to as "the impossible turn." I've written about the "impossible turn" before. AvWeb's Paul Bertorelli takes another look at the turn in the video below. Bertorelli suggests that the turn is an option that a pilot should not write off. But it does require practice.
My advice is to practice with plenty of altitude. I've had two cases involving fatalities resulting from turning back after simulated engine failures during flight training. One is here.