Is there any text editor which supports Markdown (Ask Ubuntu style formatting) which can be used to write questions or answers while you are offline?
Try Retext which supports markdown. Retext has been in Ubuntu since 12.04 precise. For earlier Ubuntu releases, or if you want a more recent version of Retext, get it from the project home page or from a PPA.
This will install Retext.
If you want a gedit plugin with markdown support:
Note: You can anytime preview markdown by entering Ctrl+Alt+M.