In the past, "we" was commonly used in single-author papers, to mean "the author and the reader" or to refer to everyone in the field in general. However, this usage is no longer encouraged, and using "I" in single-author papers is recommended. Using "I" throughout the paper is perfectly fine; it is not considered arrogant or impolite.
However, it is not grammatically incorrect to use "we," provided the context is right. For instance, you can say "using this theory as a premise, we can definitely conclude that...." Of course, you have to be really careful of the context when using "we" in a single-author paper. When referring to an experiment that you have conducted or data that you have collected, you should use "I," not "we." For example: "I collected samples of x from 10 different patients using...." Using "we" in this case might give the impression that someone helped you with the experiment. Another option in such cases, where you are unsure, is to use the passive construction: "Samples of x were collected from 10 different patients."
It is also preferable to use "I" when expressing your personal opinion as opposed to the general view about something: "While the commonly accepted view about this is..., based on my findings, I can argue that...."
Preferably, use “we” sparingly in a single-author paper. Use “I” as far as possible, and the passive construction in places where “I” might not be the best choice. If at all you use “we,” always keep the context in mind.
You might also be interested in reading these informative posts: