Tell me please if I need to include the preposition with in the following sentence?
I need something to write (with). Could anyone give me a pen?
I need something to write with = I need to write something, but I need something I could use to write that something down on a paper such as a pen on a pencil.
I need something to write = I need to write something about something or someone such as a story or an essay.
Always use prepositions when in doubt. Yes you do need 'with' here. The asking for a pen makes the intention clear. A pen wouldn't help you to find something to write 'about'. And if you had meant this then you would have needed the 'about'.
To be grammatically correct, the sentence should read: I need something with which to write.
In casual, colloquial speech, the "with" has migrated to the end of the sentence. So: I need something to write with.