I took an English assessment test online and this was my answer:
Someone suggested to go for a walk.
My answer was wrong and this was the correct sentence:
Someone suggested going for a walk.
Can someone please explain why my answer was wrong?
A suggestion (what is suggested, the object of the verb suggest) is a noun. You can't use an infinitive verb where a noun is required.
Going here is a gerund, a form of the verb go which functions as a noun.
[Note that suggested can followed by that and a finite verb, "suggested that we go". That's different; that is a conjunction introducing a clause expressing purpose, end, aim, or desire.]
'Someone suggested TO GO for a walk' implies that you are going somewhere for your walk. 'Someone suggested GOING for a walk' implies just the act of walking itself, without inference to any location to take the walk.