Warren Buffett’s Berkshire Hathaway will invest $5 billion in Bank of America, stepping in to shore up the company in the same way he helped prop up Goldman Sachs during the financial crisis.