How are proofs normally constructed in a write up, in one line or split up into multiple lines?
How a proof is written up depends on the purpose and the audience.
Your example looks like an exercise in a first course in discrete mathematics asking you to demonstrate some elementary formal reasoning about sets and functions. The instructor (or grader) should be able to check your argument without struggling with formatting. So the first version is clearly better than the second.
The first one would be even better with some blank lines (paragraph breaks) between sections of the argument, and a few more words telling the reader what part of the argument is next.
In textbooks and in research articles much more of the argument in a proof will be in words. It's the ideas that are important., The author will assume that the reader can produce a more formal proof.
The first one is way easier to read. I'm always telling off students who squash all their work up into a tiny space. Apart from reading it, it's also much easier to write comments on specific bits when it's spaced out. Paper is not expensive any more, so there's no reason to cram everything in.
If you must do the second, at least double-space the lines and put space between paragraphs.
People often say that papers are written like the latter. This is true, but people who are writing papers hopefully know what they're doing, and have been in the business a lot longer than people writing homework. Whereas on homework, you are expected to get things wrong, or inaccurate, or miss things out: the whole point of having someone look at it is to correct these things. (Even PhD theses are usually set double-spaced.)
I would opt for the second style, with slight variations. I would have formulated the two statements that need to be proved such that one uses $\subset$ and one uses $\supset$. Then I would have made each of the proofs of these two statements a paragraph and added headings "$\subset$" and "$\supset$", including the quotation marks.