Is it better to insulate the attic floor, the roof, or both?

Unless you are finishing the attic for living space, you should insulate the attic floor to contain the heat within the living space below.