Children are inquisitive by nature. When they are younger, it's usually because they want to better understand something. When they are older, it's because they want to better understand why you think something is important and why they should also feel the same way. Regardless of their age, it's imperative that when setting forth the rules and expectations in your home, your child understands there is no room for questioning the rules you set forth and the consequences of breaking the rules.
Older children, adolescents and teenagers alike will probably require more from your explanation. When they question "Why?" or "Why not?" it's best to directly, honestly and clearly state your reasoning. "I asked you to be home by 10 p.m. because we have to be at the dentist's office first thing in the morning for your check-up and we can't be late." It is also a great opportunity for you to reiterate the consequences of breaking the rule. "If you are not home by 10 p.m., you'll be grounded from going to your friend's house for a week." Be consistent, be firm, and be clear.
Though your child may challenge you by asking your reasoning why a rule has been put in place, it also shows their growth as an individual thinker. So try not to get angry or frustrated when they do so, realize it's their way of understanding their world around them.