When you rent a bike, do they provide you with a lock so you can eat or go into a museum and leave your bike outside?
So is it a good idea to pack a bike lock?
A general guideline for packing light: For something you use once, you should rent, especially something as heavy as a bike lock.
The answer depends on where you are. In Belgium and the Netherlands, many of the bikes have a sort of rear wheel lock built in. It doesn't secure the bike to an inmovable object, like a fence or a rack, but when locked, it renders the bicycle impossible to ride.
I haven't seen this device on bikes in Germany, however.
This entirely depends where you rent from. Sometimes you will be charged more for a lock, sometimes they provide one, and sometimes they don't have any. Sorry, it's a vague answer but it's a fairly vague question.
I would be careful about packing a bike lock. We didn't know it was against the rules. We made it through security at CLT and JFK with a cable and lock, but it was confiscated from my husband at security in Dublin and me at AMS. You are not allowed to fly with objects that can be used to restrain someone.
We have rented bikes all over the Netherlands and Belgium and once in Germany and they have always come with a lock. Most of the time it is the rear tire lock mention above, but sometimes it includes a chain that locks in with the rear tire lock.
If you find yourself needing a bike lock repeatedly, they are very inexpensive at the market in town (5-10 euros).