What is the function of "ved" here? Is it an untranslatable yet essential part of this sentence? Could I build the sentence as "Du rører ikke den"?
It is difficult to explain, but for it to sound proper without "ved", then I would structure the sentence as follows: "Du rører den ikke". I think the best explanation is that "ved" means that it touches something physically. I am trying to think of counterexamples but cannot come up with any. So if it's touching physically it would be with "ved", but if you touch somebody emotionally, then it would be without. I tagged the team, and hopefully one of them or a kind soul here knows better than me.
Well, it's one of those things caused by the eternal language change. Originally, røre was an intransitive verb, meaning it took only a subject and no object. Similar to how to sleep takes only a subject (you can't say I sleep you) but to punch is transitive (I punch you, subject and object). So in order to attach an object, you had to use a modifier, similar to how you can say I cause you to sleep (but not quite).
Another variant is berøre from the prefix
be- which is a (no longer productive) modifier to turn a verb into a transitive verb (similar to smile - besmile in English. I besmile you - I smile upon/towards you). This prefix is found in a LOT of verbs in modern Danish, similar to Dutch and German (my research tells me).
Today, however, røre is used by many people as a transitive verb with the same meaning as røre ved and berøre. To me, it still sounds a bit strange, but that's just how it is :)
Ahh linguistics in the morning!
In any case this sentence is a bit confusing, because it sounds like a command, but it's actually in the present tense, not imperative. I.e. it means you are not touching it, as a statement, not do not touch it which would be (du) rør ikke ved den.
the statement in english is "you aren't touching it". The form you have here is imperative
Do in English is both indicative and imperative, so this sentence is either, especially with the subject included.
That being said, your sentence would probably lead to less confusion. I'll change the "best translation" to that instead :)
Maybe this is stupid because I feel like I should know this by know, but I'm having trouble with when to use den/det.
For this it should allow both, because we have no idea what gender "it" is. However, if we know which gender "it" is, then we need to use the correct "den/det" in order to reference it. So if it is common gender ("en") then you have to use "den" when talking about it. And "et" and "det" for neuter. There are however cases where "det" is used even when talking about a common gender, this is mostly when using it as "that".
Why "don't you touch it!" is incorrect? I know there's a slight difference in the meaning, but would it be differently translated?
The Danish sentence is not imperative, as "don't you touch it" is :) It's hard to tell in English because the verb is conjugated the same, but in Danish the imperative would be rør and not rører.