On the seventh and eighth ballots, Matt Gaetz cast a vote for Donald Trump.
What would have happened if Donald Trump (or any other person) had won a majority and had wanted to take that function?
In an answer to another question, I found the following:
In theory, the House "sets its own rules". If it decides that Kim Kardashian is to be made speaker, whether she likes it or not, then Kim is speaker (whether she likes it or not).
But as the speaker is (AFAICS) a member of the House, wouldn't that mean that Congress would have to increase the number of seats? And could Congress do so, because the House cannot do much without a speaker?