How to get correct week number in Apex

This has more to do with the ISO 8601 Date format than Salesforce. A week in a year starts on the first thursday in the calendar.

ISO 8601 Week Dates

If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in week 01. If 1 January is on a Friday, Saturday or Sunday, it is in week 52 or 53 of the previous year (there is no week 00). 28 December is always in the last week of its year.

Edit:

While the above is true, it doesn't apply to you. I see what you are saying now. It seems to work when formatting this way:

DateTime.newInstanceGmt(Date.newInstance(2014, 1, 5).toStartOfWeek(), Time.NewInstance(12,0,0,0)).format('w')