Another way to say "a pen is used for writing." is "When writing, you can use a pen."