If I get max rep with one faction, is it possible to lose a rank by doing quests for the other faction, like the photo quest?
Good question. Let's say you're max rep with the raiders and you do the Davenport quest to sell the photo to Ward. You will NOT lose reputation. You will also NOT lose reputation if you do the Ward settler quest and kill the thief that happens to be a Raider.
There would be a situation where you could lose Settler reputation by doing the Ward quest and convincing the Raider thief to give you caps in exchange for letting them walk away. In that instance, you would lose Settler rep (I believe even if you have max rep with them too - so just be careful).