I have always been curious about the backstory of this photo. I had an email discussion about it earlier this year with Thelma Todd biographer William Donati who thought it may have been taken on the set of her 1929 film Naughty Baby. He had never seen the film but had seen a poster for it that had a beach scene. Made sense to me. This was confirmed recently when I was glancing through a 1928 copy of Cine Mundial on archive.org and found the photo with a caption that roughly translates to: "Charles Chaplin with Thelma Todd, the First National blonde, and the directors with the same company, working on "Ritzy Rosie.""Ritzy Rosie" would eventually be released as Naughty Baby. This still did not answer the question of why Charlie was in a bathing suit, but with a little further research I found the following picture of actress Anita Stewart, also dressed in a bathing suit, visiting Thelma's Naughty Baby co-star Jack Mulhall on the same Santa Monica beach location set (note the building in the background is the same). The caption that accompanied the photo stated that the picture was taken during a break from filming "Ritzy Rosie."
There is also the pic I posted not too long ago of Charlie with wrestler Nick Lutze which appears to me to have been taken on the same day (judging from Charlie's hair and bathing suit). Perhaps they were having some sort of swimming party on the set.
As far as the other two men in the photo with Charlie and Thelma. The man on the right is director Mervyn Leroy. The man on the left has elsewhere been identified as Hal Roach but this is up for debate.