No Curls with Purls
First, I think it helps to understand why the curling happens. Each stitch has tension, and the tension pulls in a certain direction. When all your stitches are identical, they all pull in the same direction.
So the answer is to use some stitches that pull in the opposite direction. Purl stitches, being the opposite of knit stitches, pull in the opposite direction of knit stitches.
You don't need equal amounts of purl stitches as knit stitches; a border around your knit piece will work just fine.
This piece is made with two purl stitches on each end of every other row. So one row is Knit All, and the next row is Purl 2, Knit to two stitches before the end, Purl 2. (If you want a pretty edge, add a slip stitch at the beginning of each row by skipping the first peg.) The finishing edge has a row of knit stitches then a row of purl stitches alternating for several rows.
The garter pattern shown here is only one of many possible combinations of knit and purl stitches that can be used to prevent curling. But the key is that you must use some combination of both stitches to make a flat piece lay flat.