> I automated part of someone else's job in my free time – how to proceed?
Fist, a misconception, there is no such thing as "free" time (opportunity cost: whatever you do means you're not doing something else in that same time that might benefit you more).
You likely used an hour in which you were not expected to work as work time (as others pointed out, check your employment contract's IP clause and the IP laws of your country).
Write a memo that _proposes_ what you have already built and share it with your manager. If you receive positive feedback, ask would it be valuable if you went ahead and tried your luck, given that you had the idea (and stress that it won't impact your day job!). If you get permission, show the resulting demo, but only after a substantial piece of work of your main job has been completed. Don't give the impression you dropped everything just because you had an idea. Add the line to your CV/resume that you "Proactively conceived and implemented a system that automated a mechanical human process in another department on top of daily duties.", and it may or may not help you get a little bonus and/or promotion at the end of the year - ensure there are other good things you have done in the same year, in particular close to your daily duties).