Your mouth and nose are just holes, both connected by the same tube to your lungs. It's your lungs that do the breathing. Your lungs expand/get bigger, causing a vacuum and sucking air through those holes into your lungs. Then your lungs get squeezed by your ribs, pushing the air out through the same holes. Obviously your lungs cant get bigger and smaller at the same time, and air can't flow in both directions down the same tube which is why you can't breath out through your mouth and in through your nose at the same time... OR CAN YOU!! There is actually a trick, done by musicians such as trumpet, saxophone and didgeridoo players called "circular breathing".
Note from Lydia Samuel - babies can also circular breathe when they are drinking milk from their mums! They lose this ability as they get older and start drinking from cups, but it can be retaught later in life for those wanting to play the instruments mentioned above.