- Do they need to have similar lexical semantics (derivationally related)? The word "writer" refers to the job and the word "write" refers to the action of said job. Do they share the same lexeme?
This depends on how grammarians of given language or author of dictionary treat them.
At least in English, "write" and "writer" are separate lexemes.
- Do they need to belong to the same syntactic category? For example some words are semantically very similar but are used in different parts of speech. Do the word forms "run" (noun), to move rapidly, and "run" (verb), rapid movement, belong to the same lexeme/lemma?
This again depends on how grammarians of given language or author of dictionary treat them.
I think that in English, any noun and homophonous verb (e.g. noun "run" and verb "run") are treated as separate lexemes. However action nouns created from verbs with suffix -ing (e.g. "running") could be treated as belonging to lexemes of verbs.
In many languages, adjectival participles, which are syntactically adjectives, are treated as belonging to lexemes of related verbs. (Some languages have also adverbial participles, which are syntactically adverbs.)
In Latin, gerund and supine are some special nouns which belong to lexemes of verbs. Latin has also other deverbal suffixes (e.g. -tio, -tus (genitive -tūs), -tor) used to create nouns, which are not treated as belonging to lexemes of verbs.
In Old Japanese, verbs had form with suffix -aku, which was syntactically noun, and referred to action. (In modern Japanese, productive method of nominalization is by using separate words (の, こと, もの) placed after verbs.)
Japanese adjectives have forms with suffixes -sa and -mi, which are syntactically nouns, and refer to degree and quality of given feature ("-ness, -th") (e.g. atatakai "warm", atatakasa "(degree of) warmth", atatakami "(quality of) warmth")
- Do they need to have the similar etymology?
There are sometimes situations where words with different etymologies have merged into single lexeme. This is called suppletion.
E.g. English ["be", "being", "been"] are from one root, ["am", "are", "is"] are from another root, ["was", "were"] are from another root. In modern English, they belong to the same lexeme.