Both scales are linear (the graduations are evenly spaced.) Thus, I can arbitrarily determine my own scale for a thermometer:
0 degrees bear is the temperature of bear shit I found in the woods on a Saturday in late November. 100 degrees bear is what I mark the rectal temperature of the bear on my thermometer. That is, pop that thermometer out, draw a line where the mercury (or dyed alcohol) is, and call that line 100.
On your Fahrenheit scale, my 0 is your 40 degrees. My 100 degrees is your 90 degrees. So, my scale goes up 100 degrees, while your scale only goes up 50 degrees. That is, a change of 2 degrees on my scale corresponds to a change of 1 degree on your scale. Now, to do a conversion, we merely have to do a slight shift.
Let's say that you measure something to be 50 degrees F. You want to convert it to Bears. You note that it's 10 degrees above the F temperature that corresponds to the 0 on my scale. [In other words, 50 - 40 = 10]. And, you know that 1 of your degrees F is equal to 2 of my degrees B. So, 10*2 = 20.
The formula, thus, looks like this:
B=2(F-40)
Or, to convert the other way, let's say I measure a temperature of 60 degrees Bear. I'd know that each of my degrees was 2 of your degrees. So, I'm 30 of your degrees above my zero. My zero is 40 of your degrees. That makes it 70 of your degrees.
F= (1/2)B + 40
0C corresponds to 32F
100C corresponds to 212F
So a change of 100 degrees C = a change of 180 degrees F
100/180 = 5/9
180/100 = 9/5
And, I think you can figure out why you add or subtract the 32 now.