Here's an excerpt from the piece Chromatic Invention from Bartok's Mikrokosmos, volume 3, page 39. I don't get why at the end of the lower line the bass clef indication is repeated. Is this "for security" like it's sometimes done with accidentals? But why do that here? This line is not ambiguous at all, is it?
There is an excellent motivic analysis of this piece by David Bennett Thomas.
For the question about beaming: This piece is built, like a Bach Invention, from the development of a single melodic motif. The beaming is used to make that motif clear, even when it gets rhythmically misaligned relative to the barlines, or split up by rests.
The bass clef is more puzzling. It doesn't seem necessary, and it may well be a typo, as others suggested. I note that it is not present in the analysis score that I linked above. However, its worth pointing out that this is the first time in the piece that the left hand goes that low in the bass, so it might be a friendly reminder that we aren't switching back to the treble clef again, and that the piece really does go that low. It's hard to say.
I think the extra bass clef is a reminder. The last note before the crotchet (quarter note) rest is D (above middle C). It is the last note in a rising chromatic scale, the next note of which might conceivably be D# or E (above middle C). Therefore, the musician might be expecting the next note to be in the vicinity of E above middle C, not over an octave lower as marked. Their hand would be ready to play such a note, not a note over an octave lower.
The E above middle C is written on the bottom line of the stave in treble clef. The composer wants the G two octaves below middle C to be played, which is written on the bottom line of the bass clef. To avoid confusion, the composer has added the additional bass clef as a reminder.