If someone asks me to be a beta-reviewer for a book and I had to write a feedback for it, how should I organize the text, what do I need to do to not offend the author and give constructive feedback and what writing style should I adopt (formal, informal)?
The answer would greatly depend on who you're beta-reading for, and what they ask you for. One writer might have specific questions they'd want you to answer. Another would just ask for your impression. One might want to hear your opinion (in person, or on the phone), another might want it written down. Some authors might ask you to focus on some specific thing that has to do with your area of expertise, whatever that is. Others are looking for more general feedback.
First and foremost, do what you're asked to do. If you're asked specific questions, answer them. If you're asked to focus on some particular element, make sure to address that.
For myself, if a beta reader can find nothing to improve in my draft, or only notices typos, that beta reader is useless to me. I'm not looking for praise, I don't need them to "spare my feelings". I need to know everything that's wrong with my work, so I can improve it. So I would say, everything that doesn't work for you - tell the writer about it. Say what doesn't work, and why it doesn't work. The why is particularly important. "I don't like this character" is less helpful if you can't say why you don't like them.
Whatever you're writing, whether positive or negative, be as specific as you can. "This is great work" tells me nothing. "This character's internal monologue resonated with me" is informative.
@MonicaCelio adds, and I agree with her, make note of examples. Note down the page number (or % point or whatever) where something particularly stands out -- dialogue that seems out of character, confusing description, etc. Either it'll end up being a one-off, or it'll be the first of several examples of a particular problem. Then you can point to specific things: either "this stands out", or "there appears to be this problem, here are some examples".
How you style the feedback also depends on what the writer wants to receive. If they gave you a set of questions, follow each one with an answer - there's your format right there. For myself, I find bullet points much easier to work with than a wall of text. But maybe someone else would like to have a paragraph of your impressions - whatever works for them.
How formal you need to be depends on who you're beta-reading for. If you're doing this for a friend, address them as normal. If it's someone you've never met before, you might want to be more polite.