With the default Raspberry Pi keyboard layout and a US keyboard, when I press Shift+| the result would be ~
and if I press on ~ or Shift+~ I would get a different symbol.
With the default Raspberry Pi keyboard layout and a US keyboard, when I press Shift+| the result would be ~
and if I press on ~ or Shift+~ I would get a different symbol.
Do other keys not function as you wish, as well? Such as # outputting €?
Make sure you have set the correct locales and default locale using sudo raspi-config.
sudo locale
sudo dpkg-reconfigure keyboard-configuration
sudo reboot
You can get the | (pipe) symbol using the Shift + \ shortcut. The Shift can be found on the left side of your keyboard, on the second row from bottom.
The \ (backslash) key can usually be found above the Enter key (on the fourth row from bottom).

On other keyboards, it is located on the left side of a keyboard, next to the Shift key:

(images are edited versions of pictures found on http://www.wpclipart.com/computer/hardware/keyboard/keyboard_black.png.html and http://www.keyboardco.com/keyboard_images/black_foreign_chicony_keyboard_large.jpg)