I know to write, it is just that I am behind on my school work. Should I be writing a book?
Life as a writer rarely means that you get to write and not do anything else. The number of writers (excluding journalists and other purveyors of non-fiction, usually on assignment) who make a living exclusively from their writing is very small. Almost all writers have some sort of day job, some teaching, others engaged in other quotidian endeavors. It's those jobs that actually pay the bills and not the writing itself. Failure to do the day job means failure to get paid which means failure to be able to provide oneself with food, shelter and clothing, which means inability to write.
I say all this as a prologue to pointing out that as an eleven-year-old, your school work is your job. Schoolwork has to come first, unfortunately (or not—I'll get back to that). You can use your writing as a means to motivate yourself to finish school work. For example, finish your math homework, you get 15 minutes of writing time (you'll need to adjust the balance according to your actual workload). You can talk with your language arts teacher about your writing and perhaps find a way to turn your book writing into school work (I had a high school teacher who decided the best use of my senior year English class was to write a novel rather than to do the reading).
Now the other thing that's worth noting is that as a writer you need to be endlessly curious about everything. Turn your schoolwork into research for things you might write about. How can you take the things you learn in science class or history or social studies and employ them in your own writing? Even the math can be helpful, if only to persuade yourself that you can do anything if you put your mind to it. One thing that you might find useful is writing out how to do the math that you're learning. You'll develop the ability to express complex thoughts and as an added bonus, you'll understand the math better.
You're young, so you there's a lot more that you don't know than you do know. Think of school as a way of expanding your idea bank so you'll never run out of things to write about.
Should you be doing schoolwork? Yes. Is it okay to be writing? Also yes. Is schoolwork more important than writing? Um...
In the grand scheme of things, you should probably be doing homework and stuff before writing. I put writing after school and essential living functions(ie breathing, eating, etc. I know it gets hard to put the pencil down when you're really in the zone, but you can't write very well if your dead) but before social relationships and sleep. Don't do that, because I'm not a very
alive smart sane person. Most of the time.
Writing, unless you're making it your career which will probably be hard, should be rather low on your priority list, right around with your hobbies of videogames or whatever it is you do for fun/hobbies. Maybe a bit higher if you are selling it for money. If you are grounded or something, you probably need to put writing on hold while you fix whatever you got grounded for.
Education, whether it be at the primary or post-secondary level, is always important. At your age, I would highly recommend relegating writing (especially writing a book) to a hobby, an extra-curricular activity if you will, and focus primarily on your education. The hard truth of the matter is that education, particularly at this point in your life, is far more paramount than purely writing. However, that isn't to say that you can't use writing as a way to maintain the knowledge that you receive in your education or as a release for when things get frustrating when you have down time and your school work is finished.
Learning to balance your writing with responsibilities is an important part of being a writer!
Take opportunities to write where you can, but don't let your life suffer for it. Do schoolwork, housework, jobwork and the like first. Then you can write with a clear mind. I find I write better when I am not bogged down worrying about other things. Also, you can relax into it more, not having to fend off the negative feelings that come with knowing you need to stop soon.
Avoiding burning out and getting tired is the most important thing. If you get good at that early, you can avoid serious pain later on.