When I politely asked 'What is that?', I was told 'Look it up yourself.'

Literal

'That [topic-は] what [copula-ですか]' [quotative-と] humbly-asked-[conditional-したら] 'self [by-で] investigate-[command-なさい]' [quotative-と] was-told-[regret-てしまいました].

お聞きしたら uses the humble お + verb-stem + する pattern for 'I humbly asked.' The response 自分で調べなさい 'look it up yourself' uses the mild imperative なさい — the contrast between the polite question and the curt reply creates humor. 言われてしまいました adds regret at being rebuffed.