Please help me with my problem.
Is it correct to say, His companion was I. I found some examples like, His [companion] was myself, but I think that pronoun myself was incorrect, apart from the permissibility of the inversion,
Well, firstly, I would say, "I was his companion." and neither of the above.
That said, even though you have given a short sentence, the answer will depend on context. If "His companion was I." were written in the 19th century, this is exactly what we would expect to see.
The idea that the verb to be takes the nominative as an complement, is rapidly disappearing (except in some English as a Foreign Language, and similar, exams ) It sounds very formal and old-fashioned, therefore, myself/himself, etc. is used.