useful for doing"The pen is useful for writing.""The pen is useful to write." The second sounds wrong. "For (verb)" seems to be for the function of an object.

useful to do"It's useful to do your chores before relaxing.""It's useful for doing your chores before relaxing."In this case, both sentences are grammatically correct, but they mean something different. The first means, "Doing your chores before relaxing is convenient." The second means, "Some object is helpful for the purpose of doing chores before relaxing."

I write this correction because this post comes up first on google when searching for "useful for".