In the electrolysis of water hydrogen ions are liberated as hydrogen gas at cathode so the hydroxyl ions left are basic in nature. They turn red litmus blue while hydroxyl ions go towards anode in anodic compartment and are liberated. The solution left is acidic which turns blue litmus red.