Mattress stitch is a cool way to vertically connect two pieces of stockinette stitch fabric so it looks like a continuous piece. For the purposes of illustration, different colored swatches and yarn are used in the photographs.
Mattress stitch is worked one stitch in from the edge, which makes it easy to work and covers up the messy edge stitches.
To begin, give your knitting a gentle pull between the first row and the second row of knitting. You'll see a series of little bars of yarn running between the stitches. These are what you use to stitch the pieces together.
Slide your sewing needle under the first bar.