Same thing happened to me recently; I had a clear gap, I indicated and went to move into it. I was technically giving way, the car was behind me and we were matched for speed. They sped up and I continued across. Even with the speed up, I was still clear, albeit somewhat closer. I got a letter from the cops, they actually reported me. No fine, it's a simple 'don't do it'. I will be responding.
If the lane is 'zippered' like the diagram, your lane ends and you have to give way. If it's just a lane line that ceases, the car in front has right of way.
I think (need to confirm) but the law for giving way is that if another car has to vary speed (or lane change) by a certain amount to avoid collision, it's a failure to give way. Pulling in front of someone isn't necessarily a failure to give way.