Can a CFI give required instruction and endorsements on a 3rd class medical?
A CFI with a third class medical can provide any kind of instruction that they are qualified for (and be compensated for it), per 14 CFR 61.23(a)(3)(iv) and (v). The FAA's position in these scenarios is that you're being compensated for the transference of knowledge, not the operation of the aircraft. 

For completeness, A CFI can provide instruction WITHOUT a medical if they are not flying PIC or acting as a required crew member. In this scenario training can be provided for certain additional ratings (e.g. commercial) or flight reviews AS LONG AS the student can PIC during that flight AND the CFI is NOT a required crew member (i.e. safety pilot for insturment training).  Additionally, the FAA has made a legal interpretation that a CFI can provide instruction to a pilot that is not current to carry passengers, as long as all other requirements for the student to be PIC can be met.

The specific regulations that allows this are 14 CFR 61.3(c)(2)(viii) and 14 CFR 61.23(b)(5)