How can I display the Item ID with Optifine without F3?
F3+ H in the game. Then you would need to have Advanced Tool Tips.
The only thing I know is F3+ H for advanced tooltips. Otherwise, there's nothing to my knowledge without mods. OptiFine only cares about the graphics and performance.
Maybe you mean what the mod, WAILA "does (What Am I Looking At).