Citigroup will pay $7 billion to settle a U.S. Justice Department investigation into subprime mortgages.