look/stare/gaze into space
stare (off) into space
To stare vacantly or absentmindedly at nothing in particular, usually while one is preoccupied with or distracted by thoughts of something else. I sat at the back of class, staring off into space, when suddenly the solution came to me. He just stared into space as his parents lectured him on the importance of paying attention during class.