Is it grammatically necessary to use any in the following sentence? Can I omit any in exams and formal writings in similar sentences and contexts?
When you use 'any' before a plural or an uncountable noun, the focus is on its amount or number. Thus, when you say:
a) I didn't post any photos. (The focus is on the number of photos).
b) I didn't post photos. (The focus here is on the existence of photos,i.e. you didn't post photos, but you may have posted other things).
Michael Swan 3rd edition, page (47):
With an uncountable or plural noun, any usually suggests the idea of an
indefinite amount or indefinite number.
Yesterday was Mother's Day, but I did not post any photos of my mother on social media. I think my mother's position / role in my life cannot be described by just clicking pictures or posting them on social sites on a certain day.