Initial and final de Sitter universes from modified f(R) gravity