Can I rest cement posts directly on the bedrock to build a structure for a large shed?
Piles to bedrock (essentially what you are proposing, albeit with really short piles) is an excellent foundation. I'd suggest drilling some holes in the rock so you can pin (with steel rebar) the base of the concrete post/pile into the bedrock. 

I don't think you'll have any issues with the freezing - it will happen, but the bedrock isn't going anywhere, and the building set on piles set on bedrock won't, either.