Although I have done a lot of research I still do not know if I can use a real secondary school in my book. Can I do this? Are there precautions I can take if I do? What are my options? Should I contact the school and ask?
You can use a real secondary school. However, there are advantages and disadvantages to be aware of.
You are able to visit your setting and take notes on various details that can help bring the setting to life for the readers. These details do not need to be limited to the physical setting, but can also include notable incidents (in the eyes of the narrator/viewpoint character, of course) that occurred at the school or people who attended/worked at the school. If it's a school you've attended or are attending, then you are also able to draw on your own experiences there. Using an actual secondary school can also help make your details more concrete, as you might be more aware of specific details to use.
Because you are using an actual place, people will be able to know when you adjust details to tell a better story or get details wrong. And these details people will nitpick over will include not just the depiction of the setting, but also the events and people described in the story. Depending on the school, you might find a treasure trove of information to use as setting and character research for the time period the story takes place in or you might find little to nothing at all. Plus, you may find yourself feeling constrained in what you can write about as you include actual people and events related to the school. You'll also have to be careful in your depictions, as presenting too negative a depiction of the school or actual people could be construed as libel. While this post talks about the risks of using real people, some of what it says is applicable to writing about real places.
My suggestion for a fictional story would be to take the secondary school you have in mind and use it as an inspiration for a fictional secondary school you create. This allows you to make use of the advantages of having a real location while avoiding most of the disadvantages. Be sure to adequately change the names and possibly use a disclaimer.
My suggestion for a nonfiction story would be to use the secondary school as a setting if it is important to the story being told. And be thorough in your research.
I don't know the reason why you want to use the name of the real place (unless it's such a famous place that not doing so would seem strange).
But you should be sure to include a prominent disclaimer on the title page that it is a work of fiction and any resemblances are entirely coincidental. (You may be subject to invasion of privacy lawsuits if someone can demonstrate that you based it on a real event at that school). If you are doubly-paranoid, you could include an additional note --"obviously, the school here is a real school, but none of the events actually happened as described."
It sounds possibly like you want to have the best of both worlds. You want to use the inside information about the school to provide verisimilitude while at the same time you want to deny that it is based on reality. Or: you want to use a well-known school as a way to draw attention to your work while not wanting to say anything truthful about it.
I have encountered the issue in a significantly smaller way. I mentioned characters as attending two or three universities that I knew fairly well (although I had only attended one). I needed a concrete name of a university rather than just making one up -- also, I needed the university to be tied to a specific city which was the setting for my story. At the same time, my story is very obscure -- nobody would find it, and the setting itself wasn't that crucial to the story. Also, these were short narratives. If I were writing a longer narrative, I would carefully consider whether I wanted to use a real university in a particular city, or whether I wanted to disguise it somehow.
Finally, my advice would be to ask whether it would be easy or likely for a potential reader to misunderstand the aim of the literary work or to interpret the plot as having to do with an actual school. Also, would people find these references to be inflammatory or offensive? Is there a possibility that the events in the novel could come true at some later point -- and provide notoriety to the book? If you describe a murder at a school, and then 5 years a murder takes place at the school with similarities to the fictional murder, that would complicate your life. What if someone read the book and staged a copycat killing?
By the way, one of the universities I used in a story was a university I despised -- and I portrayed it somewhat negatively in the story. On the other hand, I don't think most readers would think that the author was criticizing the university -- even if the character didn't like it for some reason.
Finally, I would generally not contact the school for permission. That sounds a little too creepy.