Checking whether a grammar is ambiguous or not is an Undecidable problem, which means that there exists no algorithm which will correctly output Yes/No to this problem every time.
The undecidablity is shown by showing that it is equivalen to Post Correspondence Problem, which is also undecidable.