First of all--I'm a beginner too! That's the only reason I know this...b/c I just recently discovered it myself.
Anyways, when you alternate a row of knitting with a row of purling, it's called stockinette stitch. It's great for sweaters and other things that you need round, because (as you saw) it rolls inward.
To keep your scarf flat, either do garter stitch (knit every row), or do some kind of alternating pattern IN EACH ROW. For example, K2, P2, K2, P2, etc.
Over in the "How to Questions" forum, there's a post at the top called "How to keep your stockinette from curling" or something similar to that.
Phew! Hope that all helps!!