Grammar is something I really hate, but it's useful.
Literal
Grammar [topic-は], my greatly-hated thing is-but, is-beneficial.
大嫌い is the emphatic negative of 好き — 'really hate/detest.' The structure 私の大嫌いなもの ('the thing I greatly dislike') uses a な-adjective modifying もの. ですが provides a polite concessive 'but.' ためになる means 'to be beneficial/educational.'