Citigroup announced Monday that it will pay roughly $7 billion to settle a federal investigation into risky subprime mortgages, the type that helped bring on the financial crisis.