When an accidental is used at the beginning of a measure, it’s effect lasts for the entire measure. For example, if at the beginning of a measure we have a B flat, and then at the end of the measure there is another B, it is also a B flat unless there is a natural sign in front of it. An accidental can’t have an effect over a bar line.
An accidental affects all the subsequent notes of same pitch within a measure.
correct. for clarity, there is often a "courtesy" sharp, flat, or natural to indicate when the accidental is no longer used, especially if an accidental is used several measures in a row before it is not used again. but this is not a universal style of writing.
Those "courtesy" naturals absolutely drive me crazy.