Elon Musk has offered to buy Twitter for about $41 billion, just days after rejecting a seat on the social media company's board.