We prove the following results: (1) There is a one-relator inverse monoid Inv A | w = 1 with undecidable word problem; and (2) There are one-relator groups with undecidable submonoid membership problem. The second of these results is proved by showing that for any finite forest the associated right-angled Artin group embeds into a one-relator group. Combining this with a result of Lohrey and Steinberg from 2008, we use this to prove that there is a one-relator group containing a fixed finitely generated submonoid in which the membership problem is undecidable. To prove (1) a new construction is introduced which uses the one-relator group and submonoid in which membership is undecidable from (2) to construct a one-relator inverse monoid Inv A|w = 1 with undecidable word problem. Furthermore, this method allows the construction of an E-unitary one-relator inverse monoid of this form with undecidable word problem. The results in this paper answer a problem originally posed by Margolis, Meakin and Stephen in 1987.