Answer + explanation:
1. Writing the function
You know that for every mile it costs 40 cents, or 0.4 dollars, so you can write this as 0.4m.
You also know that there is an initial fare of 2.5, so you add that.
Then you have F = 0.4m + 2.5
2. Find the better choice
Since she has to travel 5 miles, you can plug m = 5 into the function to see the cost:
F = 0.4 * 5 + 2.5
F = 2 + 2.5
F = 4.5 or $4.50
Since $4.50 < $8.00, you know that the cab would be the cheaper and better option.