It’s the taking, as well as the posting, that is copyright infringement (or not)
Copyright infringement happens when you make a copy. In the case of a photograph, that’s when you take the picture. Posting it on Facebook, is also an infringement, and might make the copyright owner aware of a violation but a violation has already happened even if no one ever looks at your picture.
It is copyright violation is your picture is a copy of or a derivative work of the painting.
So, if your photo is of the painting such that the painting is the primary subject of it, then it’s a copy and, subject to exceptions (e.g. study) is a copyright violation.
If your photo uses the painting in a significant way to create a new work, for example, juxtaposing your friend so they appear to be kissing the Mona Lisa (only that particular painting is public domain so copyright doesn’t apply), then it might be a derivative work. This gets complicated by jurisdiction. For example, in the US, making the derivative is the violation, in Canada, the derivative must be multiplied so posting it is the violation. Again, all subject to exceptions.
However, if the painting is incidental background to the photo, for example, “here’s Sam the Philistine out of place with a lot of works of art”, then it is neither a copy nor a derivative work.