As you probably know, any transactions that occurred on a specific date should use the exchange rate on that date. You can find this on well-known websites (e.g., x-rates.com etc.).
For averages, the IRS will accept any reasonable method for determing the average. For example, for a yearly average, it is probably not sufficient to average the exchange rates on the first and last days of the year, but it probably it is sufficient to average the first or last days of each month (12 rates total), especially for an exchange rate that is not wildly fluctuating.
Whatever you do, be sure to document the rate you used and how you determined it, and keep it with your tax records.