Emacs
(The following solution is really for writing in Spanish. If just a
¿ is to be inserted once or twice in your document then the other answers might be more appropriate)
A convenient way to write Spanish in Emacs with an American QWERTY keyboard is to use the input methods spanish-prefix or spanish-postfix (for a general introduction into input methods see Emacs User Manual - Sect. 22.3 - this is very convenient framework if you have to edit/compose text in several languages).
For spanish-postfix the following key combinations enable to write the diacritics and special characters of the Spanish language:
KEY SEQUENCE
------------
You can input characters by the following key sequences:
key char [type a key sequence to insert the corresponding character]
--- ---- --- ---- --- ---- --- ---- --- ---- --- ---- --- ----
!/ ¡ A' Á I' Í O' Ó a' á i' í o' ó
?/ ¿ E' É N~ Ñ U' Ú e' é n~ ñ u' ú
Doubling the postfix separates the letter and postfix:
a'' -> a' n~~ -> n~, etc.
key character(s) [type a key (sequence) and select one from the list]
--- ------------
U" Ü U"
u" ü U"
For spanish-prefix it works like this:
effect | prefix | examples
------------+--------+----------
acute | ' | 'a -> á
diaeresis | " | "u -> ü
tilde | ~ | ~n -> ñ
symbol | ~ | ~> -> » ~< -> « ~! -> ¡ ~? -> ¿
Above tables are excerpts from the information you get by doing M-x describe-input-method on the respective input methods.
In order to activate the input-mode you press Ctrl+u Ctrl+\ and enter spanish-postfix or spanish-prefix. Now the key-combinations are activated, e.g. pressing ~? (spanish-prefix) or ?/ (spanish-postfix) produces the desired ¿.
If you are done with writing non-QWERTY characters, you can switch back to the normal input method by pressing Ctrl+\.
Windows > 8
One way is to switch the global input method back and forth between your default keyboard layout and a Spanish keyboard layout. For a detailed HowTo see here: https://kb.wisc.edu/helpdesk/page.php?id=27310