How to write math well? Let's learn about writing good mathematical texts. 
For some people it could be especially interesting to answer about writing texts on Math Overflow, though I personally feel like I've already mastered a certain level in writing online answers while being hopelessly behind the curve in writing papers. So,

What is your advice in writing good mathematical texts, online or offline?

 A: There's a set of notes from a class on mathematical writing that  was run by donald knuth that you can find in various locales, here's one link. Its not up to date with respect to online writing (being 20 years old), but it should still have some good gems! 
A: One useful strategy (after a few years' experience) might be to read your own papers from a few years before. Do you still understand your own proofs and explanations ( or would you, if you were reading them from "scratch" without your own prior knowledge)? If the answer is "no", or "with difficulty", you might ask yourself why, and what could be done to improve that in future writing.
A: Halmos has already been mentioned, but I'd like to record the following: It may be helpful to employ spiral-writing (a-la Halmos) but at the paragraph level, rather than the chapter or section level as he suggests. So, write a paragraph, then the next one, looking back to see if the previous can be clarified in light of the one written. I suggest this because the paragraph is supposed to be the natural unit of composition, and if C.S. Peirce was right, clarity is utility. Spiral writing at this level may help not only exposit mathematics but also do mathematics. Each subsequent thought we attempt requires a better utility from what has been previously written...and the only way to guarantee such increased utility is to have attempted this subsequent thought and then carefully had a look at exactly what was needed in prior paragraphs to develop that thought. 
I guess that in summary I have only two new things to add here. 1. Halmos's spiral writing is philosophically sound from the standpoint of early pragmatism, and 2. Maybe it can be effectively employed at the paragraph level instead of the section/chapter level.
Of course, Halmos suggests writing a chapter at a sitting as a way to fight inertia...so my second suggestion in the previous paragraph may not be actually better, only personal.
Anyhow, I was going to record this thought in my own personal notes, but thought maybe someone else may have a use for it as well. 
A: Currently I am reading the book "A primer of Mathematical writing" by Steven Krantz. I have found it extremely useful. It is helping me with my thesis and 2 papers. 
The book covers everything from grammar, writing papers, CV, grants, job applications, books, book reviews, referee report, expositions also technical aspects like bibliography, index, appendix and even time management. 
The book is published by AMS, here is the amazon link.
A: One trick that my advisor, Ronnie Lee, advocated was to use a descriptive term before using the symbolic name for the object. Thus write, "the function $f$, the element $x$, the group $G$, or the subgroup $H$. Most importantly, don't expect that your reader has internalized the notation that you are using. If you introduced a symbol $\Theta_{i,j,k}(x,y,z)$ on page 2 and you don't use it again until page 5, then remind them that the subscripts of the cocycle $\Theta$ indicate one thing while the arguments $x,y,z$ indicate another. 
Another trick that is suggested by literature --- and can be deadly in technical writing --- is to try and find synonyms for the objects in question. A group might be a group for a while, or later it may be giving an action. In the latter case, the set of symmetries $G$ that act on the space $X$ is given by $\ldots$. Context is important. 
Vary cadence. Long sentences that contain many ideas should have shorter declarative sentences interspersed. Read your papers out loud. Do they sound repetitive? 
My last piece of advice is one I have been wanting to say for a long time. Don't write your results up. Write your results down. You figure out what I mean by that. 
A: You may also wish to take a look at the references on math (and more broadly, science) writing listed here.
A: When you read mathematical writing for your own understanding, sometimes it goes smoothly and sometimes not. When it doesn't, that may be because the mathematical ideas are inherently difficult and complicated; but sometimes it's because the notation, the sentences, or the argument aren't as well expressed as they could be. In the latter case, try rewriting the awkward section in a better way so that the meaning is clear.
After you have practiced this habit for a while, try transferring it to previous pieces of your own writing. Finally, after leaving it for a few days, critically revise your new writing.
Additionally, I suggest that you read the works of great mathematicians who strike you as writing particularly well. Examine the details of how they write, from the smallest scale (e.g. how they use subscripts and superscripts, and how they punctuate) to the largest—for example, how they cross-reference, so that the reader who has lost the thread can easily pick it up again, and how they use repetition and alternative description to reinforce the reader's understanding of key ideas.
A: I can't say much about textbooks from the perspective of the producer, so I'll say something from the perspective of a consumer. 
I like books that are good at what Terry Tao referred to as "information hiding".
http://terrytao.wordpress.com/advice-on-writing-papers/create-lemmas/
http://en.wikipedia.org/wiki/Information_hiding
My favorite textbooks somehow manage to give me all the excruciating details when I need them but only the intuitive picture when I don't.
A: Hmm, I'm about twelve years late to the party - anyway, since the post has just popped up at the front page, here's a list of suggestions that I try to follow when writing mathematics, mainly because it reflects my preferences when I read mathematics.
(I'll phrase the suggestions in imperative mode, since I try to keep telling them to myself when I write. The enumeration is there to facilitate reference to the single suggestions in potential comments; it does not indicate importance.)

*

*(1) Do not write down things how you think they should be written down; write things down how you would like to read them if the author were someone else.


*(2) Length of mathematical writing can be measured (a) in numbers of words, lines and pages, and (b) in the amount of time a reader needs to read and understand what you have written and to get all information relevant to them while doing so. Try to write as brief as possible, but measure length exclusively in terms of (b).


*(3) Do not introduce unnecessary notation.
Example: I've seen books introduce an extra symbol for the imaginary line, which everyone who does not use the book on a regular basis has to look up; this is pointless, $i\mathbb{R}$ works just as well.


*(4) Apply the first paragraph of Scott Carter's answer also to equations or formulas you're referring to.
Not so good example: "Assume that (3) and (6) hold. Then the equation $Au = f$ has a unique solution $u$, and $u$ satisfies (11)."
Better example: "Assume that the integrability condition (3) holds and that the operator $A$ satisfies the ellipticity estimate (6). Then the equation $Au = f$ has a unique solution $u$, and $u$ satisfies the regularity property (11)."


*(5) Whenever possible, try to avoid enumerating equations and formulas; this will force you to be more disciplined about the structure of your text. This applies in particular, but not exclusively, to proofs.


*(6) Try to avoid acronyms for mathematical properties. Most definitely avoid using half a dozen lengthy acronyms for various mathematical properties.


*(7) Do not assume that readers will read your entire paper (they won't). Results should be self-contained wherever possible.


*(8) Do not, under any circumstances, scatter various assumptions for a theorem throughout the text, when the theorem is worded in a way which makes it impossible to note from the theorem alone that these assumptions apply.


*(9) When citing a theorem, include the theorem number. If the paper you cite is very short and has only five pages and two theorems, include the theorem number anyway.


*(10) Do not use long list of references without providing the reader any guidance about these references.
Not so good example: "Recently, there has been a lot of interest in magical theory X [2, 3, 6, 7, 9, 10, 12, 13, 16, 19, 21, 22, 31, 32, 34]." Such lists of references are useless, since nobody will look up all those papers without any more precise indication of what to find there.
Somewhat better example: "Recent progress in magical theory X includes various results towards a classification of all magic wands [2, 3, 10, 34], new insights into the long-term decay of magic energy [12, 13, 16, 19] and several counterexamples which show that the color of a sorcerer's hat is logically independend from the color of their magic wand [6, 7, 9]. A very recent development is the extension of numerous classical results into the realm of super-magics in non-zero characteristics [21, 22, 31, 32]."


*(11) When using a result you cite, try to indicate at least briefly what the result says.
Not so good example: "... and hence, [2, Theorem 3.11] implies the claim."
Somewhat better example: "... and hence, the open mapping theorem [2, Theorem 3.11] implies the claim."


*(12) Try to encode mathematical properties in words rather than in notation.
Not so good example: "Preliminaries. Within $\mathbb{C}^{d \times d}$, we denote the set of all positively semi-definite matrices by $\mathcal{PS}$, the set of all positively definite matrices by $\mathcal{P}$, and the group of all invertible matrices by $\mathcal{GL}_n(\mathbb{C}^d)$. ... 5 pages later ... Theorem. We have $\mathcal{PS} \cap \mathcal{GL}_n(\mathbb{C}^d) = \mathcal{P}$."


*(13) Try to use notation that is self-explanatory.
Example: If $\sigma(A)$ denotes the spectrum of a linear operator $A$, denote its point spectrum by $\sigma_{\operatorname{pnt}}(A)$ rather than by $\sigma_{\operatorname{p}}(A)$.


*(14) In lenghty arguments, state the goal before giving the argument.
Bad example: "For $x \in \mathcal{S}$, the previous inequality implies that ... 10 lines of involved reasoning ... This shows that $x$ is foo."
Somewhat better example: "Next we show that each $x \in \mathcal{S}$ is foo, so fix such an $x$. ... 10 lines of involved reasoning ..."


*(15) When you prove that assertions (i), (ii) and (iii) are equivalent, start the proof of each implication in a new paragraph which begins by stating the implication that will now be proved. Do not write "Now we prove that (ii) implies (iii)", but simply write '(ii) $\Rightarrow$ (iii)' at the beginning of the paragraph. Do this even in cases where the implication is trivial; in such a case the entire paragraph might only consist of the line "'(ii) $\Rightarrow$ (iii)' This implication is clear."
This gives a clear visual structure to the proof which makes it much easier for readers to get an overview of the proof and to readily find a specific argument they are looking for.
Some people might claim that this suggestion is "bad style" or "ugly". Whether or not this claim is correct is irrelevant. Style is important, but readability is more important.


*(16) When your theorem says "$A$ if and only if $B$", do not use the words "Sufficiency" and "Necessity" to structure the proof. Whenever I read this, I find it annoying that I first have think about which implication is actually meant. Instead, proceed similarly as in point (15): start the proof of each implication in a new paragraph, and begin the paragraph with one of the symbols '$\Rightarrow$' and '$\Leftarrow$'.
As above, some people might claim that this is "bad style" or "ugly". But as above, readability has priority over style.


*(17) When you define a property which has several equivalent characterizations, use the following guideline to choose which of the equivalent assertions you use as the definition:
The major purpose of definitions is not to be easily checkable or to be easily applicable, but to structure a theory in an intuitive way; good definitions can guide us through a theory. Hence, choose a property for the definition which is most likely to help the reader to understand what is going on. (In some occasions this will indeed be a property that is easy to check or easy to apply; but in some other occasions it won't, and you will have to outsource the equivalent properties that are easy to check or easy to apply to a theorem.)


*(18) When splitting a proof into several lemmas, do not try to be overly efficient (in terms of logical deduction) when formulating the lemma. When the proof of your theorem requires knowledge of the implication $A \Rightarrow B$, but you can actually show that $A \Leftrightarrow B$, then your lemma should (in many cases) state the equivalence, even if the converse implication is not needed anywhere in your paper.
Reason 1: Lemmas are not just proxies for steps in a proof; they also help the reader to get a better understanding of the entire situation, and the question wether the converse implication holds is part of this understanding.
Reason 2: While you might need only the implication $A \Rightarrow B$, your reader might need the converse implication. While it might be more or less clear to you that the converse implication holds, it might not be so clear for your reader.
Background information (in order to assess the validity of my suggestions): I've been told by a non-empty set $S_1$ of mathematicians that my mathematical writing is quite good. I've also been told by a non-empty set $S_2$ (which is disjoint from $S_1$, and smaller in cardinality) of mathematicians that my mathematical writing is quite bad. Clearly, I won't comment on who is right...
Disclaimer: I'm quite sure that I have violated almost all my suggestions multiple times in the past.
A: P.Halmos in How to write mathematics (easy to be found via your favorite www search engine) gives some nice advice. Or try Serre's exposition Writing mathematics.
A: Halmos's article contains a lot of good advice at the tactical level, the writing equivalent
of "face your audience".  This is stuff you have to get straight: if your notation is crazy
then your potential readership is already zero.  Fortunately this is largely a matter
of acquiring good habits.
Next, you have to constantly keep your reader in mind.  Whenever you are faced with
a choice, ask "What would be best for my reader(s)?"  It can be useful to assign someone
you know well to this role, because it makes it easier to stay consistent.
Remember that it is much more important to be clear than it is to be complete.
Be prepared to do a lot of rewriting.
If you follow these suggestions, you will with practice become a competent writer.
To become a good writer is much more difficult.  Writing good mathematics is no easier,
and no harder, than writing good prose on other topics.  Read a lot, find good examples
that you like and think carefully about why they work.
A: I don't feel experienced enough in mathematics writing to give advice.  But I like Terry Tao's advice on writing mathematics papers; he also provides links to some other people's advice.
