I’ll NECESSARILY write the book in the future.
This may or may not be technically correct in this sentence, but it is really awkward and would never be said. The only way I've ever heard the word used is coupled with not. (e.g. Apples are not necessarily red.) Necessarily stems from "need" with the meaning "needs to be" or "is always".
I’ll SURELY write the book in the future.
The best one of this list, although it does have a slight implication that you are guessing/hoping that you will write the book. Surely is more often used for sentences like "Surely my team will win this year".
I’ll write FOR SURE the book in the future.
This is grammatically incorrect. A correct sentence would be something like "I'll write the book in the future FOR SURE." This is just another form of SURELY so the same implication applies.
I’ll OBLIGATORILY write the book in the future.
I have never heard this word used in conversation and it would be extremely awkward in this sentence. Obligatorily stems from "oblige" or "obligation" and means "is required to". In this sentence it would mean that someone is forcing you to write the book.
I'm assuming that you are only using this sentence to help you understand these words, but in case you are interested, a better word to make the sentence understandable is absolutely. (I’ll ABSOLUTELY write the book in the future.)