Which is correct?
(a) Auf dem Tisch liegt ein Kugelschreiber, mit dem ich normalerweise schreibe.
(b) Auf dem Tisch liegt ein Kugelschreiber, damit schreibe ich normalerweise.
I think only (a) works. Is that right?
Your version (a) is completely correct:
Instead of mit dem (preposition + relative pronoun), the pronominal adverb womit can be used:
It doesn't sound quite right, though (but not actually wrong either); at least I do not like to refer to a concrete object with womit, whereas it is fine when referring to a class of objects:
Damit is a demonstrative pronominal adverb, which means that it cannot introduce a relative clause; therefore, your original sentence (b) before Takkat's edit was wrong. It can be used in a second main clause, however, to refer back to something mentioned before, so sentence (b) as it is now is fine. Note the different word order:
Instead of the comma, the sentences could as well be separated by a semicolon or a full stop. Unlike the connector (pronoun) in a relative clause, which has to come first (except for a possible preposition), damit is more free:
The pronominal adverb damit has also developed into a subordinating conjunction with the meaning so that, in order to. This conjunction introduces a subordinate clause, with corresponding word order. It is just that your example sentence makes no sense with this conjunction. However, this variation would be fine:
For the edited version of the question, both version work quite well. If you change the word order of the second version (as was in the original), you change the meaning as follows: b) "On the table is a pen, so that I normally write. So you are using the word "damit" to express a purpose.
Both sentences are correct but only (a) contains a relative clause. (b) contains two main clauses that could easily be expressed in two seperate sentences:
This cannot be done with (a). Also note the word order in the subclause of (a):