Mattress Stitch is a sewn finishing technique used to invisibly seam two pieces of knitting together. There are a couple varieties of mattress stitch, use the variety that gives you the most invisible seam.
1/2 Stitch Mattress Stitch
Anchor yarn on WS or use yarn tail. Working from the RS, bring threaded tapestry needle up into the center of the edge stitch. Line up the other piece and take the needle across to that piece, going down into the corresponding place, *run the needle under 2 horizontal bars of yarn and up to the RS on the same side. Now go back to the place where the yarn came up on the first piece, going down and repeat from *. Pull yarn to close up seam as you go, also pulling it vertically to maintain stretch.
1 Stitch Mattress Stitch
Anchor yarn on WS or use yarn tail. Working from the RS, bring threaded tapestry needle up into the space between the edge stitch and next stitch OR into stitch above CO or BO edge. Line up the other piece and take the needle across to that piece, go down into the corresponding place, *run the needle under 2 horizontal bars of yarn and up to the RS on the same piece. Now go back to the place where the yarn came up on the first piece, going down and repeat from *. Pull yarn to close up seam as you go, also pulling it vertically to maintain stretch.
Mattress Stitch Hybrid
Anchor yarn on WS or use yarn tail. Working from the RS, bring threaded tapestry needle up into the center of the edge stitch of Body garter stitches and into the space between the edge and next stitch of the Yoke and Sleeve stitches. Line up the other piece and take the needle across to that piece, going down into the appropriate place, *run the needle under horizontal bars of yarn and up to the RS on the same side. Now go back to the place where the yarn came up on the first piece, going down and repeat from *. Pull yarn to close up seam as you go, also pulling it vertically to maintain stretch. There will need to be some adjustment to keep the pieces even.
See also: backstitch, whip stitch, seam – rows to stitches, Kitchener Stitch – Grafting Knitting, garter seam, flat seam, baste, sew snap tape to front bands, sew snap tape