Margaret Knight didn't invent the paper bag, but those first paper bags weren't all that useful for carrying things. They were more like envelopes, so there was no way they'd become the grocery store staple that they are today. For that, we have to thank Knight. Knight realized that paper bags should have a square bottom; when weight was distributed across the base in this way, the bags could carry more things.
In 1870, she created a wooden machine that would cut, fold and glue the square bottoms to paper bags. While she was working on an iron prototype of the machine to use for her patent application, she discovered that her design had been stolen by a man named Charles Annan, who had seen her wooden machine a few months earlier. She filed a patent interference suit against Annan, who claimed that there was no way that a woman could have developed such a complex machine. Knight used her notes and sketches to prove otherwise, and she was granted the patent for the device in 1871.
That was hardly Knight's first patent, though. At the age of 12, Knight had developed a stop-motion device that would automatically bring industrial machines to a halt if something was caught on them, which prevented many injuries; all told, Knight was awarded more than 20 patents.