Is "Where was I" a correct grammatical sentence?
To make it grammatically correct you would need to complete the sentece by giving more information such as a time period:

"Where was I last night at 11pm?"

"Where was I on holiday last year?"

"Where was I?" can be used as a stand-alone sentance, for example if you were narrating a story but got interrupted. When you continue your story you might say "Where was I?" as in "Where was I in the story I was telling?"