How to join 2 complete knitting

sorry if double post
this is my first knitting. im making a scarf. at first i make the casting on too long (i didnt count it) so it looks like this

dunno why it can become wider and a bit arched.
i though i can just stop the knit and make a new knit with same height then join them like this

so the question is what technique should i use to join them?
and if i want to combine with another color like this

would it be looks good?

thx before :wink:

Hi, you can use the mattress stitch (show in the Finishing section) to join the pieces.