Duality and Serre functor in homotopy categories