EDIT: It appears that you want to replace an image on a site that is not yours. If you do not have legitimate access to the site's webserver or CMS system, there is nothing you can do. I'm leaving the rest of my post below just in case I have misinterpreted:
I'm assuming that you want to do this in Javascript, as you tagged your post with "Script." Other script languages exist, of course, but only Javascript really has a meaningful installed base.
First you need to assign the image an ID, something like:
<img src="/images/cat.png" id="mypicture">
Then, inside your Javascript, you can alter the image's source like so:
document.getElementById('mypicture').src = "/images/dog.png";
You can take this technique pretty far, even adding stuff to the image tag like:
<img src="/images/cat.png" id="mypicture" onClick="document.getElementById('mypicture').src = '/images/dog.png';">