If a rocket fails whether on the launch pad or after the lift-off, how is it determined what component failed?
What are the different methods by which failure is determined?
This is pretty standard post incident analysis, with extensive data:
The telemetry stream is incredible. Data from almost every flow, temperature, speed, angle, pressure sensor etc., is fed live to control.
Depending on the type on failure, there may be very little left, or if an explosion happens in space there may be nothing recoverable, however generally there are components and even entire modules that survive in one form or other.
Video is shot from on board, and from hundreds of cameras on and near the launch site, as well as down range. Combined with thousands of public videos from mobile phones etc., there is usually fotage from every angle imaginable.
Once information is gathered, simulations provide an insight into triggers for particular behaviour. For example, correct telemetry up until a particular sensor failing, followed closely by ctastrophic failure gives a good indication that something near that sensor may have been to blame, so simulations that can model failure near the sensor are considered.
It's worth looking at the documentaries on the two Shuttle disasters. They go into great detail on all the possible failure modes that match the data they had, used existing samples, ran stress tests and simulations.
See this question and answers there for a bit of information on radio tracking.
There's an excellent video by Paul Shillito (Curious Droid) How did NASA get those great film shots of Apollo and the Shuttle? that describes the evolution of camera systems used to monitor spacecraft on their way up and down. It states that the launch of STS-114 had over 400 cameras for example.
Recording of imagery of launches with catastrophic and near-catastrophic events has been a critical step in the analysis of both actual failures and close calls. Without this, telemetry data alone would be insufficient. It is only one step in the process, but without data, there is no further analysis.
An example of some of the largest ones is shown in the image below, and is discussed further in this question as well as the answers there.
below: Contraves-Goerz Kineto Tracking Mount (KTM), from here.