There is a gedit-plugins package available for Ubuntu. Install that and take a look at the Draw Spaces section in the gedit preferences. You can configure it to show spaces, tabs, line feeds etc.
You can use this command in a terminal: sudo apt-get install gedit-plugins