Ambiguity in regular and context-free languages I understand the following claims to be true:


Two distinct derivations of a string in a given CFG may sometimes attribute the same parse tree to the string.
When there are derivations of some string in a given CFG that attribute different parse trees, the CFG is ambiguous.
Some context-free languages generated by ambiguous CFGs are also generated by unambiguous CFGs.
Some languages are such that the only CFGs that can generate them (and there are some such) are ambiguous.


Q1. I understand it also to be undecidable whether an arbitrary CFG is ambiguous, in the sense of point 3 above. Or is it rather that it's undecidable whether a context-free language is ambiguous, in the sense of point 4? Or are both undecidable?

Q2. Which of points 1-4 become false when we replace "context-free" with "regular"? Are regular grammars and languages always unambiguous?
About Q1:
Both the ambiguity problem (given a CFG, whether it is ambiguous) and the inherent ambiguity problem (given a CFG, whether its language is inherently ambiguous, i.e. whether any equivalent CFG is ambiguous) are undecidable.  Here are the original references:


The undecidability of ambiguity was proved by Cantor (1962), Floyd (1962), and Chomsky and Schützenberger (1963).  The proofs in textbooks typically reduce from the Post Correspondence Problem.
The undecidability of inherent ambiguity was proved by Ginsburg and Ullian (1966).




About Q2:  A regular grammar is a "one-sided linear" context-free grammar, where at most one nonterminal appears in any rule right-part, and where that nonterminal is at the last (in right linear grammars) or first (in left linear grammars) position.  Such grammars are easily translated into equivalent finite-state automata (roughly by considering each nonterminal as a state), which are unambiguous iff the regular grammar is unambiguous.  The class of unambiguous regular grammars and unambiguous automata has been studied in particular by Stearns and Hunt (1985), who show that they enjoy tractable algorithms for the inclusion problem.


About the relationship between derivations (i.e. sequences of rules applications $\beta A\gamma\Rightarrow \beta\alpha\gamma$ where $A\to\alpha$ is a rule of the grammar) and derivation trees (i.e. where a node labeled $A$ is the parent of a sequence of nodes $X_1,\dots,X_m$, where $A\to X_1\cdots X_m$ is a rule): in a general CFG, there can be different derivations, which visit the same derivation tree in different ways.

These different derivations occur because one has a choice between applying a grammar rule in two different places in a sentential form: in a sentential form $\gamma A\eta B\theta$ with at least two nonterminals $A$ and $B$, one can apply $A\to\alpha$ first and obtain $\gamma\alpha\eta B\theta$, or $B\to\beta$ first and obtain $\gamma A\eta\beta\theta$, but applying the other rule will lead to the same $\gamma\alpha\eta\beta\theta$.  Imposing leftmost (always deriving the leftmost nonterminal in any sentential form) or rightmost derivations imposes a fixed order for visiting derivation trees, and there is then a single derivation for a given derivation tree.

In a linear context-free grammar, there is no such choice, since there is at most one nonterminal in any sentential form, and there is a single derivation for a given derivation tree, which is both leftmost and rightmost.
Having two different parse trees with the same yield $w$ (sequence of leaves) is the definition of $w$ being ambiguous, it does not change when considering regular grammars.  Alternatively, one can also ask for two different leftmost derivations.  Note that a derivation in a one-sided grammar corresponds to an accepting run in its associated finite-state automaton, which is called ambiguous exactly in the same way: when there exist two different accepting runs for a given input $w$.
and 4.$~$  If you take the finite-state automata view, it suffices to determinize your ambiguous automaton in order to obtain an unambiguous automaton for the same language: there will be a single run for any given word.  This deterministic automaton is equivalent to an unambiguous regular grammar.

To answer your comment: there exist ambiguous regular grammars, for instance $S\to A\mid B,\,A\to a,\,B\to a$ has two leftmost derivations for $a$: $S\Rightarrow A\Rightarrow a$ and $S\Rightarrow B\Rightarrow a$.  An equivalent unambiguous grammar is $S\to a$.


About the relation with Q1: it is decidable whether a regular grammar is ambiguous (the inherent ambiguity problem is not very challenging on regular grammars, since the answer is invariably "no" without even looking at the input grammar).  This can be checked in $O(|G|^2)$ using a squaring construction on its associated automaton: construct the product of the automaton with itself, and see whether some state $(q,q')$ with $q\neq q'$ is accessible and co-accessible.  The oldest reference I know for this idea is a paper by Even (1965).